basic.stop

Statement/BASIC Program, Releases: AP and R83

Terminates program.

Syntax

stop stop error.message.number, 'parameter'{, 'parameter' .. }

Description

stops program execution and returns to the invoking the process.

The parameter{s} are passed to the error message handler and the message stored in 'error.message.number' is displayed.

The 'stop' statement is similiar to the 'abort' statement, except the 'stop' statement terminates execution of the program without going into the Pick/BASIC debugger. Control returns to the calling program, PROC, or Macro.

Example

>open 'invoices' to inv.file else stop 201,'invoices'

The 'stop' statement above stops program execution if
'invoices' can not be opened, and prints the designated error message
with a passed variable parameter. If the 'invoices' file does not
exist, the following message displays:

[201] 'invoices' is not a file name

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

If the item referenced by the variable 'id' is not on file, the
program stops and displays the following:

[202] 'id' not on file.

The actual item-id is displayed in the error message.

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.abort Statement Terminates program and PROC{s}.
filename.messages Definition Contains system messages.
basic.open Statement Opens file for input and output.
basic.end Statement Compiler directive.
basic.error Statement Displays error message.
basic.begin.work Statement Starts a transaction

User Comments

What do you think?

Share your experience or ask a question by using the form below.

Login to leave your comments.