Terminates a GFA-BASIC program and returns back to the calling program.
Quit [i]
i:integer expression
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.
OpenW # 1, 10, 10, 200, 100, -1
Quit
Compiled programs are terminated with Quit as well.
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
{Created by Sjouke Hamstra; Last updated: 21/10/2014 by James Gaite}