I WRITE it here so it overlays the previous screen displayed, this is especially useful if there are no records to display in the current subfile.
Rpg Code Examples Free Format CalculationsAfter a few minutes of Googling most of the examples I found were in RPGIII, a few were in fixed format RPGLE, and a couple had free format Calculations.This was rather disappointing as RPGLE is over 21 years old, free format calculations 14 years old, even free format definitions RPG is in its third year. All of the examples I found looked overly complicated for a beginner, so I decided to create this post showing a simple subfile program written in modern RPG. I am sure that my examples are not the way all other IBM i developers would write theirs. There are probably as many ways to write a subfile program as there are programmers who write them, each with his or her own coding peccadillos. If you want to use an Expanding subfile (subfile size subfile page) or a Page at a time subfile (subfile size subfile page) you can use this example as a starting point. I am not going to go into detail about it as I have written about it previously in the post No More Number Indicators. There is a single character field that will be used so that the user can enter a value to, for example, edit, view, delete, etc. Indicator 31 is used just to control the display of the subfile, if there are no records in the subfile I do not want to display it. Indicator 30 is used for all the display of the subfile control, and I want More. If the user has a problem with the program I tell them to give me the name of the screen and I know what program to work with. This way if I copy or rename the program it will always show the current programs name. Rpg Code Examples Code In TheIf you are not able to use the totally free RPG, but can use free format definitions, then you will need to start your code in the eighth column, and ignore the FREE. ![]() But if you prefer use subroutines you can replace the subprocedures, by replacing the call to the procedures with EXSR, DCL-PROC with BEGSR, and END-PROC with ENDSR. I use this to get the programs name which I use for the screen name on the subfile control record format. I need the INDDS to give the name of my Indicator Communication Area data structure. ![]() What I like about these data structures is I can map an indicator from the display file to a meaningful name. For example: indicator 3 from the display file will be known as Dsp.Exit as the data structure subfields are qualified, see the QUALIFIED on line 8. I will be using this to contain the previous value of Z1POSITION. In other programs I have coded this as a hidden field in the subfile control, but I am keeping this example simple. ![]() As I am using a Load all I do not have to code of the user pressing the Page Up or Down key the subfile does all that for me behind the scenes.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |