ABORT, ABORTE, ABORTM |
![]() ![]() ![]() |
The ABORT statement terminates the current program, returning to the command prompt. ABORTE and ABORTM provide compatibility with other multivalue database products.
Format
ABORT {print.list}
where
If an ON.ABORT paragraph is defined in the VOC, this will be executed before the command prompt is issued.
The program location at which the abort was generated will be reported unless the SUPPRESS.ABORT.MSG option has been set using the OPTION command.
Because ABORT terminates all active programs, menus, paragraphs, etc., it should only be used to handle error conditions.
The Pick syntax of ABORT can be enabled by including a line $MODE PICK.ERRMSG in the program before the first ABORT statement. In this syntax, the ABORT statement becomes
ABORT {msg.id {, arg...}}
where
See the ERRMSG statement for a description of the ERRMSG file message format.
The ABORTE statement always uses Pick style message handling and the ABORTM statement always uses Information style message handling, regardless of the setting of the PICK.ERRMSG option.
Examples
IF NO.OF.ENTRIES = 0 THEN ABORT
This statement aborts to the command prompt if the value of the variable NO.OF.ENTRIES is zero. No error message is printed. ABORT statements without error text messages can result in difficult diagnostic work to locate faults.
OPEN "STOCK.FILE" TO STOCK ELSE ABORT "Cannot open STOCK.FILE - Error " : STATUS() END
This program fragment attempts to open a file named STOCK.FILE. If the open fails, the program displays an error message and aborts to the command prompt.
See also: |