Quit Command

Purpose

Terminates a GFA-BASIC program and returns back to the calling program.

Syntax

Quit [i]

i:integer expression

Description

The Quit command terminates the current GFA-BASIC program and returns to the calling program. Optionally, a 16 bit integer value can be returned to the calling program. The following convention applies:

i = 0 the program was executed without error.

i > 0 an internal program error has occurred.

i < 0 an operating system error has occurred.

Example

OpenW # 1, 10, 10, 200, 100, -1

Quit

Remarks

Compiled programs are terminated with Quit as well.

Known Issues

Using Quit in the IDE with or without the optional 16-bit integer can lead to an 'Access Violation' error as shown in the example below:

Local i As Int16 = 0

OpenW # 1, 10, 10, 200, 100, -1

Try

Quit i

Catch

Print Err.Description

EndCatch

Of more concern is, if you re-run this program, it will quit, along with the GB32 application running it resulting in any unsaved work being lost.

For more information, see here

See Also

End

{Created by Sjouke Hamstra; Last updated: 21/10/2014 by James Gaite}