Hacker News new | ask | show | jobs
by DoomHotel 1865 days 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.

1 comments

Ah, the joys of forgetting to put a period at the end of the COUNT-ROWS paragraph.
We 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