4 ms·
We used PERFORM to implement calls. Whether or not implemented with a stack, it acts the same as any call/return. So to implement a simple loop to count records
by DoomHotel 5y ago
We used PERFORM to implement calls. Whether or not implemented with a stack, it acts the same as any call/return. So to implement a simple loop to count records in a file:
PERFORM COUNT-ROWS
VARYING COUNT FROM 1 BY 1
UNTIL EOF.
And the callee did:
READ INPUT-FILE
AT END MOVE 1 TO EOF-FLAG.
- ASalazarMX 5y agoAh, the joys of forgetting to put a period at the end of the COUNT-ROWS paragraph.
- DoomHotel 5y agoWe had some coding rules to help prevent that: 1. No unnecessary periods in the code 2. Required periods (ending paragraphs and if/then/else) go on a line by themselves