ILF (Integrated Language Facility)
How to retrieve an occurrence number with ILF!
Retrieve and occurrence example:
TRN WORK DATE occurs 66 times (DD)
. . .
SET --- TEMP 30 = WORK DATE (note this is a literal)
SET 0AD ELEMENT NAM = --- TEMP 30
READ 0AD ELEMENT HOLD 0 FT 0 BY ELEMENT NAM
SET --- AI = 0AD ELEMENT OCC
AI will contain 66 in this example.
Now in 4.2 you can use the two new PDFs --- CURSOR AT APPLICATION and --- CURSOR AT FIELD
just in case the user happened to be sitting on the field of interest.
...
SET --- NEXT APPLICATION = --- CURSOR AT APPLICATION
OPEN 0AD ELEMENT
T SET --- TEMP 30 = --- CURSOR AT FIELD
T SET 0AD ELEMENT NAM = --- TEMP 30
TT READ 0AD ELEMENT HOLD 0 FT 0 BY ELEMENT NAM
...
I haven't tested this to see if it really works and I'm not sure if the
T SET --- TEMP 30 = --- CURSOR AT FIELD
would really be required.