Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Arrays/RPG/arrays.rpg
Normal file
27
Task/Arrays/RPG/arrays.rpg
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
//-Static array
|
||||
//--def of 10 el array of integers, initialised to zeros
|
||||
D array...
|
||||
D s 10i 0 dim(10)
|
||||
D inz
|
||||
//--def an el
|
||||
D el_1...
|
||||
D s 10i 0 inz
|
||||
|
||||
/free
|
||||
|
||||
//-assign first el
|
||||
//--first element of RPG array is indexed with 1
|
||||
array(1) = 111;
|
||||
|
||||
//-get first el of array
|
||||
el_1 = array(1);
|
||||
|
||||
//--display it
|
||||
dsply ('First el of array='+%char(el_1));
|
||||
//--displays: First el of array=111
|
||||
|
||||
//---or shorter, without "el_1"
|
||||
dsply ('First el of array='+%char(array(1)));
|
||||
//--displays: First el of array=111
|
||||
|
||||
/end-free
|
||||
Loading…
Add table
Add a link
Reference in a new issue