2.10 Ending a Program

Ending a Program

A program will finish when there are no more executable statements.

A program may also be ended earlier than this by using the END or STOP statement. As the END statement is used to end other programming structures, it is preferable to use STOP.

Both statements can have a value specified. This will be returned to the caller as an error or completion code.

If no value is specified or the program ends normally, a zero value will be returned, which means successful execution.

Other values can be used to indicate error or other conditions.

Commands

END [error]

Stops execution of a program, closes all open files and returns control to the operating system.

STOP [error]

Stops execution of a program, closes all open files and returns control to the operating system.

Implementation Status:

LynPlex Interpreter
Fully implemented
LynPlexC Compiler
Fully implemented
Both End and Stop are currently regarded as abnormal endings and can not be guaranteed to cleanly free all resources.
LynPlexS Compiler
End is supported as End Program.
Stop is supported but does not allow a return value.
Quit is used to provide a return value.

lynplex/lp0210.txt · Last modified: 2013/07/31 16:45 (external edit)