Modernizing RPG’s indicator with INDARA (Indicator Area) keyword


INDARA (Indicator Area) keyword for ICF files

workstn indds
indicator data structure
INDARA is used to put the field option indicators and function(response) key indicators in a separate area of memory called indicator area.

By using this keyword, we can make indicator data structure in our program to give the customized name to indicators defined in the display file. Hence, it makes the program more readable and easy to understand.

Step 1. indicate INDARA keyword in your Display File


Step 2. indicate INDDS in your RPG workstation file declaration
dcl-f PKLTSFV workstn indds(Dspf) sfile(SFL1 : SF1NUM);

Step 3. declare the indicator area

       dcl-ds Dspf qualified ;

         Exit            ind pos(03) inz(*off);

         SflClr          ind pos(50) inz(*off);

         DspAtrRI        ind pos(61) inz(*off);

         DspClrRed       ind pos(62) inz(*off);

         SflEnd          ind pos(91) inz(*off);

       end-ds ;


   

Step 4. In the RPG source program replace all the indicator in the form *inNN or *inKK with the name defined in the indicator area,
for instance:
replace *in50 = *on with Dspf.SflClr = *on;
replace *in61 = *on with Dspf.DspAtrRI = *on;
replace *in03 = *on with Dspf.Exit = *on;
replace *inKC = *on with Dspf.Exit = *on;

That’s it!

 

Verified by MonsterInsights