Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Array

Status
Not open for further replies.

Oche

Programmer
Sep 14, 2007
11
US
My DDS screen has 60 fields in which an end user can enter in a batch number. The field names are batch1, batch2, batch3, through batch60.

D array S 4A Dim(60)

When running the RPGLE (could be /free), how do I go through the 60 batch fields and load them into an array
using a do/for loop?

I do not want to have to write 60 lines of code :
array(1) = batch1;
array(2) = batch2;
etc etc etc......

Regards,
The Oche
 
1/ Insert INDARA at DSPF file level.
2/ Use overlay along with dim() to redefine the 60 fields on the relevant screen format, i.e;

Code:
d ScreenFmtDS   e ds                  extname( DSPF : FmtName )    
d  BatchAry                      4a   overlay( ScreenFmtDS : nnn ) 
d                                     dim( 60 )

DSPF = name of the display file.
FmtName = name of the relevant format in the display file.
BatchAry = Array that redefines the batch fields.
nnn = offset from the beginnig of the format (start position = position 1).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top