stop statement

The stop statement stops program execution and returns to the invoking the process.


stop errnum, "parameter"{,"parameter"...}


errnum Number of the error message to display.
parameter Text to be displayed.


The parameters are passed to the error message handler and the message stored in errnum displays.

The stop statement is similar to the abort statement, except the stop statement terminates execution of the program without going into the FlashBASIC or BASIC debugger. Control returns to the calling program, Proc, or macro.


The stop statement below stops program execution if invoices cannot be opened, and prints the designated error message with a passed variable parameter.

open "invoices" to inv.file else stop 201,"invoices"

If the invoices file does not exist, this message displays:

[201] ’invoices’ is not a file name

In this example, if the item referenced by the variable ID is not on file:

read cust.item from cust.file,ID else stop 202,ID

the program stops and displays:

[202] ’ID’ not on file.

The actual item-ID displays in the error message.