|
From: | Roger While |
Subject: | [open-cobol-list] GOBACK in main program |
Date: | Sat, 16 Jun 2007 13:53:39 +0200 |
Yes, indeed. Background to this is interesting. A couple of months ago somebody pointed out that EXIT PROGRAM should act like a CONTINUE when used in a "main" program (per 2002 standard). I changed OC to do this without realising that GOBACK was using the same code. In fact I was of the opinion that GOBACK was legacy code. Nope, it's firmly there in the 2002 standard and does indeed state that GOBACK acts as a STOP RUN in a "main" program and as an EXIT PROGRAM otherwise. Now fixed. Download as usual. Roger
I have compiled all of the main batch program (called from the script) with -m, and execute them with cobcrun. Several of the programs use a GOBACK instead of a STOP RUN to end the program. On the mainframe and MicroFocus, the programs end when it hits the GOBACK. With OC, since there is no module to return to, the goto exit_program is never executed, and the program falls through and starts to execute the first paragraph after the mainline.
[Prev in Thread] | Current Thread | [Next in Thread] |