basic.abort

Statement/BASIC Program, Releases: AP and R83

Terminates program and PROC{s}.

Syntax

abort {message#}{,'parameter'{,'parameter'..}} abort {error message string}

Description

immediately stops program execution and unconditionally returns to the TCL command prompt.

The 'abort' statement specifies an abnormal end and can appear anywhere in the program. The 'error.message#' parameter is the item-id of the desired message in the 'dm,messages,' file to be output.

The parameters are the values required by the message. If the 'string' form is used, the message string is displayed on the screen and placed in the 'dm,messages,' file.

The 'abort' statement is similiar to the 'stop' statement, except the 'abort' statement also terminates execution of any macro or PROC which might have called the program containing the 'abort' statement and aborts the Pick/BASIC program.

The 'abort' statement automatically generates error message '[b1] run-time abort at line 'n''.

Example

open 'invoices' to invoice.file else abort 201,'invoices'
If 'invoices' can not be opened, the program aborts with error
message 201 and passes in the string 'invoices'. This causes the
program to stop with the message ''invoices' is not a file
name'. In this case, both [b201] and [b1] error messages are displayed.

See Also

Command Name Type Description
basic.statements Definition Definition of statements and functions.
basic.stop Statement Terminates program.
filename.messages Definition Contains system messages.
basic.open Statement Opens file for input and output.
ue.3090 User Exit Aborts a Pick/BASIC program.
basic.end Statement Compiler directive.
basic.error Statement Displays error message.
basic.debugger.overview Introductory facilitates the debugging of new Pick/BASIC programs and the maintenance of existing Pick/BASIC programs.
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.