END statement 

Purpose

Terminate program immediately.

Syntax

END [nErrorLevel&]

Remarks

Normally, PowerBASIC programs are terminated when you exit the PBMAIN or WINMAIN() function.  It should always be your goal to end programs in this fashion, so that the compiler and the operating system can do everything possible to leave things in an orderly state.

That said, PowerBASIC offers limited support for the END statement, in order to provide an additional level of compatibility with DOS programs and simplify conversion efforts.

The optional nErrorLevel& value has an effective range of 0 to 255. Batch files may act on the result through the IF [NOT] ERRORLEVEL batch command.

Restrictions

END is intended only for temporary use in converting DOS programs to Windows.  You should convert it to the standard EXIT FUNCTION method as soon as possible.  END must never be used in a program which uses COM access.

See also

EXIT, PBMAIN, WINMAIN