Difference between revisions of "Indicators"

From MidrangeWiki
Jump to: navigation, search
Line 7: Line 7:
 
Now it is possible to have the display file's indicator data structure overlay the *IN array, by making the data structure based, and having its basing pointer point to the beginning of the *IN array.  If you do this, you're back to one set of 99 indicators, which negates the intention of having a separate set of indicators.  And it's a waste of coding time, since you have the same effect by leaving off the INDARA and INDDS keywords.
 
Now it is possible to have the display file's indicator data structure overlay the *IN array, by making the data structure based, and having its basing pointer point to the beginning of the *IN array.  If you do this, you're back to one set of 99 indicators, which negates the intention of having a separate set of indicators.  And it's a waste of coding time, since you have the same effect by leaving off the INDARA and INDDS keywords.
  
The only reason I've ever seen for mapping a data structure to the *IN array is to allow naming the 99 RPG indicators so you don't have to use *IN34 or *IN(27), which are not very meaningful.  But you don't need to use INDARA or INDDS to do this.  Simply define a based data structure whose pointer points to the address of *IN01.  This data structure does NOT have to be specified in an INDDS keyword.  You don't even need a display file.  In other words, you could have a program with an INDARA display file where INDDS points to data structure ABC, and a separate based data structure XYZ that overlays the *IN array.  That way you can name the 99 RPG indicators and the 99 display file indicators. (Peter Dow)
+
The only reason I've ever seen for mapping a data structure to the *IN array is to allow naming the 99 RPG indicators so you don't have to use *IN34 or *IN(27), which are not very meaningful.  But you don't need to use INDARA or INDDS to do this.  Simply define a based data structure whose pointer points to the address of *IN01.  This data structure does NOT have to be specified in an INDDS keyword.  You don't even need a display file.  In other words, you could have a program with an INDARA display file where INDDS points to data structure ABC, and a separate based data structure XYZ that overlays the *IN array.  That way you can name the 99 RPG indicators and the 99 display file indicators. (Provided by Peter Dow)

Revision as of 16:07, 7 December 2006


We will start with a little historical perspective. RPG has always had just 99 indicators. At some point, programmers were allowed to access them as if they were in an array (the *IN array). After display files were introduced, they started eating up all the available indicators in order to position cursors, set display attributes and what not. Pretty soon, there weren't enough indicators for both the display file and RPG.

The solution was to allow display files to have their own set of 99 indicators. This is done by specifying the INDARA keyword in the display file, and the INDDS keyword on the file spec in the RPG program. Once you've done this, RPG has its 99 indicators in the *IN array, and the display file references the 99 indicators in the data structure specified in the INDDS keyword on the file spec.

Now it is possible to have the display file's indicator data structure overlay the *IN array, by making the data structure based, and having its basing pointer point to the beginning of the *IN array. If you do this, you're back to one set of 99 indicators, which negates the intention of having a separate set of indicators. And it's a waste of coding time, since you have the same effect by leaving off the INDARA and INDDS keywords.

The only reason I've ever seen for mapping a data structure to the *IN array is to allow naming the 99 RPG indicators so you don't have to use *IN34 or *IN(27), which are not very meaningful. But you don't need to use INDARA or INDDS to do this. Simply define a based data structure whose pointer points to the address of *IN01. This data structure does NOT have to be specified in an INDDS keyword. You don't even need a display file. In other words, you could have a program with an INDARA display file where INDDS points to data structure ABC, and a separate based data structure XYZ that overlays the *IN array. That way you can name the 99 RPG indicators and the 99 display file indicators. (Provided by Peter Dow)