The STOP statement terminates program execution before the end of the program unit. It takes the following form:
If you specify stop-code, the STOP statement displays the specified message at your terminal, terminates program execution, and returns control to the operating system.
If you do not specify stop-code, no message is displayed.
Effect on Tru64 UNIX and Linux Systems
If you specify stop-code, the STOP statement writes the specified message to the standard error device and terminates program execution. The program returns a status of zero to the operating system.
If you do not specify stop-code, no message is output.
If you specify stop-code, the effect differs depending on its form, as follows:
Return code stop-code
In QuickWin programs, the following is displayed in a message
box:
Program terminated with Exit Code stop-code
In both cases, the program returns a status of stop-code to the operating system as an integer.
If you do not specify stop-code, the STOP statement writes the following default message to the standard error device and terminates program execution:
Stop - Program terminated.
The program returns a status of zero to the operating system.
The following examples show valid STOP statements:
STOP 98
STOP 'END OF RUN'
DO
READ *, X, Y
IF (X> Y) STOP 5555
END DO