|
Hello, Personnally, I do not like code like FunctionKey = '001000000001000000000000' ; It seems all but obvious. Here is some part of what we use here (probably not the best approch, but one that I find more appropriate) *overlay indicator with variables with more meaninfull name d IndicatorP s * inz(%Addr(*in)) d Indicators ds based(IndicatorP) d pc#AllFld 1 20 d pc#fld1 1 1 d pc#fld2 2 2 d pc#fld3 3 3 d pc#fld4 4 4 d ri#AllFld 21 40 d ri#fld1 21 21 d ri#fld2 22 22 d ri#fld3 23 23 d ri#fld4 24 24 d @EntFldAtr 41 41 d pc@reset s 20 inz(*all'0') d ri@reset s 20 inz(*all'0') ... pc#AllFld = pc@reset; ri#AllFld = ri@reset; ... pc#fld1 = *on; In our shop, indicator 1 to 20 are for the "position cursor" attribute (hence the pc# followed by the field name). indicator 21 to 40 are for the reverse image attribute (ri#) So it is fairly obvious that "eval pc#AllFld = pc@reset" will reset the Position cursor attribute of all field on the screen (I dont remember having more that 20 input field on one screen) If I was to use this technique to established which function keys are allowed, it could look something like this: *overlay to control function keys and action keys d IndicatorP s * inz(%Addr(*in)) d Indicators ds based(IndicatorP) d f1 1 1 d f2 2 2 ... d f23 23 23 d f24 24 24 d pageUp 25 25 d pagedown 26 26 ... d AllKeys 1 30 d SetAllKeys 1 30 inz('001000000010000000000000000000) ... AllKeys = SetAllKeys This is my answer to your request for opinion. Now I will go a little further. With this setup, I presume that you want to allow function keys (and other keys like page up/down) by conditionng them with indicators in the display file. I would advise against that for the following reason: - When a user presses the wrong function key, the keyboard locks up (a red X appear at the bottomleft of the screen) and they must press the reset key to regain access to the keyboard. I can tell you that our user used to hate that. Over here, we always allow all function keys in the display file. And in the RPG, we check which key was press and issu a message if the wrong one was used. This way, we can customize the message sent and we avoid the need to press the reset key. But this is just a suggestion. Denis Robitaille Directeur services technique TI 819 363 6130 SUPPORT Jour (EST) Daytime : 819-363-6134 En-dehors des heures (EST) After hour : 819-363-6158 Network Status : 819-363-6157 >>> Weberr@xxxxxxxxxxx 2006-01-12 14:10:39 >>> We are developing a set of Free Form RPG coding standards. (Yes, now. We are primarily a COBOL shop just moving over to RPG, stepping boldly into the 1980's!) I want to get the opinion of the group on a technique for setting DSPF indicators that was proposed. The proposal was to code a data structure for the screen indicators using the "N" data type and to use variable names that are meaningful. The technique that I am asking for opinions on is that the group of indicators can be set or tested by using a string such as: '0010000000100000000". I am intentionally not stating my opinion, so as not to affect your comments. Thanks for your input. Code snips follow. The purpose of this code it to control which functions keys are available when the screen displays: D DspFInd DS D FunctionKey 1 24 D PageDown 25 25N D Request 28 30 . . . BEGSR $S0Display; Request = '100' ; FunctionKey = '001000000001000000000000' ; EXSR $SZGET; EXSR $S1DspFmt; ENDSR; Richard L. Weber | Senior Systems Analyst, TOYS '*' US International | 973.617.3497 | weberr@xxxxxxxxxxx <mailto:weberr@xxxxxxxxxxx> ======================================================================== This email message is for the sole use of the intended recipient (s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. To reply to our email administrator directly, send an email to EmailAdmin@xxxxxxxxxxxx Toys "R" Us, Inc.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.