MC Press Web Site Staff
** This thread discusses the Content article: TechTip: Standardizing Indicator Usage in RPG IV0
Guest.Visitor
I like the idea of INDDS, but like to point out more caveats. First: You still have to use indicators in external files. This means you have two things that means the same thing. In your example: ClearSfl1 in your RPG-code but in your display-file, *IN31. I prefer having ONE thing to remember... when switching between display and program code. Hint: If IBM would allow logical variables in external files instead of indicators... Strange things will happen, if you try to mix the use of INDDS AND indicators(*INnn). I struggled a long time before I figured out(RTFM) that you can\'t mix. If you EVAL ClearSfl1=*ON or EVAL *IN31=*ON in your code makes a BIG difference. The first will do the trick, while the second won\'t do it. This follows from the fact that the external files are using a different indicator-array than *IN. The above mentioned "problem" occurs mostly during code-maintanance. If you code a completely new program and display-file, it\'ll work better. (Hopefully one knows which method is used when coding all by oneself) Comments appreciated, Kjell
D.Eckersley
I find INDDS very limiting - you can only define indicator variables, or arrays of indicator variables (I think). I prefer a data structure that overlays *IN using a basing pointer. That gives greater flexibility on how the indicators are defined and named. It can also be standardized. Also, it addresses the issues that Kjell brought up (if you use INDARA) - you use *IN, and that\'s it. Also, don\'t use indicators for function keys. Use the AID byte at position 369 of the screen\'s INFDS. That frees up 24 indicators. The AID byte can also be used to return mouse click events to your program, which indicators cannot be used for (not directly, at least).
jvalance@sprynet.com
As DougCMH said - "I prefer a data structure that overlays *IN using a basing pointer". I\'ve been using this technique for over 5 years and I see no advantage to using INDDS. You can also set up your basic standards in a /copy member and then add to the indicator data structure in individual programs (like the occasional 2-subfile program). As far as using AID vs. indicators for FKeys: AID allows you to test for the enter key and a few others, but freeing up 24 indicators? If you need more than 75 indicators in an RPGIV program then you may need to rethink your code. Unless you have converted a mega-RPGIII program to RPGIV and don\'t have time to convert some of the indicators to modern code, I would say this is a weak argument. But I do agree that AID is a good technique. Example code shows how to code this.
[size="1">Code[/size>
D.Eckersley
My comment on 24 indicators is somewhat ambiguous - sorry about that. I meant that using AID means that there are up to 24 fewer indicators used in a program. Actually, I use at most 5 indicators in any program, and these are to control subfiles. I still use indicators to change field attributes - to flag an error, for example - but I\'m considering switching over to DSPATR program-to-system fields for that, if there are benefits.
henhu2000ca
Hi guys, it looks PKS doesn\'t support INDDS. How to change the code with INDDS to make it work in PKS AX/Ware? Thanks in advance!
Please login to make comments.
User Rating: / 0
PoorBest 

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM