× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>How can I easily set off multiple indicators,
>say 20-99?

James has already heard the stock answer: to use the indicator array.  I'm
posting to advise against it.  I completely understand the hassle of dealing
with a lot of indicators, and the pain it causes when dealing with
well-seasoned code.  I've lived in that scenario for many years.

I use a single SETOFF for each indicator, with a right-hand comment about
the function of the indicator.  So:

SETON                                        40         SFLCLR
SETOFF                                       43         Disable ROLLUP
SETOFF                                       41         SFLDSP
WRITE     MDLDSPC
Z-ADD     0             RRN001                          Pointer
Z-ADD     0             RRNM01                          Highest pointr
SETOFF                                       40         SFLCLR

I believe this is easier to read and therefore easier to maintain than MOVEA
'1000' *IN(40).  I further believe that this imposes no runtime performance
penalty.  I am a radical believer that counting lines of code is a dangerous
way to evaluate a routine's quality, and strongly feel that this example
proves my point.

If I have a place where I have to set/reset 70+ indicators, I write
subroutines to do it, so my mainline isn't a hideous mess:

exsr SFLCLRon
exsr SFLDSPOff
write MDLDSPC
exsr SFLCLRoff
exsr DSPATRHiOff
exsr DSPATRBlOff

Of course, there is often the argument that there is a need for bulk
indicator setting when dealing with display file attributes.  Nowadays, DDS
supports many field attributes via a program to system field:

A            FLDA          10   B 10  2TEXT('Generic input/output')
A                                      DSPATR(&FLDAATR)

In the RPG, code to set the attribute looks like:

 * field attribute bit patterns

d NO              s              1a   inz(x'00')
no attrs
d RI              s              1a   inz(x'01')
reverse
d HI              s              1a   inz(x'02')
highlight
d UL              s              1a   inz(x'04')
underline
d ND              s              1a   inz(x'07')
non display
d BL              s              1a   inz(x'08')
blink
d NP              s              1a   inz(x'20')
non protect
d CS              s              1a   inz(x'30')
column sep
d PR              s              1a   inz(x'80')
protect

 * reset all attributes
c                   eval      FLDAATR = NP
 * reverse, blink
c                   biton     RI            FLDAATR
c                   biton     BL            FLDAATR

This can eliminate many (not all) indicators formerly used for display
attribute settings.

I hope this helps someone,
  --buck


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.