Hi All,
Can anyone please tell me what is the basic differance between arrays and tables in RPG and for which type of requirement we have to use arrays and tables.
since there might be bit difference between both of them.
Please explain me.
Software/Hardware used:
ASKED:
November 18, 2009 5:56 AM
UPDATED:
November 18, 2009 7:28 PM
Names of Tables must start with TAB
Tables came first and were usually defined in the program.
I still want multi-dimensional arrays
array(x:y) would be much clear than outer(x).inner(y)
generally speaking, tables are preloaded at compilation or program initiation and not changed during program execution … tables are most often used as a checklist or range against which variables or fields are compared using lookup operations ….tables do not have an index value available to the program to tell you which position the element occupies in the table …
arrays are more fluid and are often used to group values together, to alter or manipulate or total these values, or to search or format them … indexes are used to identify individual elements of the array, and care must be taken by the programmer to make sure never to refer to an element by an index value outside the defined range of the array or the program will abend …