defint a-z n = 1 100 if n >= 1000 then end print n n = n + 1 goto 100prints the first 999 positive integers and terminates.
Of course, this example could be better written as
defint a-z for n = 1 to 999 print n next n endNote that the end in the final line of this example is optional.
The end statement causes the process to exit with status zero. For those users sufficiently familiar with UNIX to bemoan this, a special routine is provided in Basmark QuickBASIC that causes the process to exit with a given status. For example,
call bexit(99)This program may be run and the exit status demonstrated (using the UNIX standard shell) is as follows:
$ a.out $ echo $?
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber