Authors: Bardia Mahjour, Christine Li
The STOP statement has been enhanced in XL Fortran v14.1 to comply with the F2008 standard. The stop code can now be specified using any scalar integer constant expression or a scalar character constant expression. For instance, you can now successfully compile and run the following short program:
INTEGER, PARAMETER :: rc = 2
The same program would have been invalid in previous standards, since the error code is not a string of 1 to 5 digits.
For more details and examples, please refer to the information center.
The ERROR STOP statement is new in XL Fortran V14.1. It has similar function and syntax as the STOP statement. While the STOP statement initiates normal termination of a program, the ERROR STOP statement initiates error termination. Also, when stop code is not specified, the system return code is:
0 when a STOP statement is executed.
1 when an ERROR STOP statement is executed.
Proper usage of the statement can help you distinguish the stop caused by error. For details and examples, please refer to the information center.