!return, !abort - Exit macro
The !return directive causes the current macro to exit with a TRUE status, either returning to the caller (if any) or to interactive mode. If an argument n is specified then the return status is determined by the value of n.
!abort has the same effect as !return only always returning a FALSE status to halt the execution of any calling macro. If an argument n is given to !abort the bell is also rung, the valid values of n are the same as for the !bell(4) directive.
The following example checks the current language and warns if it has not be set, i.e. Default.
; Check the current language !if ¬ &seq %language "Default" !return !endif ml-write "Warning - you have not setup the Language - use user-setup"
The following example is shows the logic of the !return directive:-
; !return example define-macro i-will-return ml-write "you will see me" !return ml-write "you wont see me" !emacro define-macro test-return ml-write "you will see me" i-will-return ml-write "you will see me" !emacro
Similarly, for the !abort directive
; !abort example define-macro i-will-abort ml-write "you will see me" !abort ml-write "you wont see me" !emacro define-macro test-abort ml-write "you will see me" i-will-abort ml-write "you wont see me" !emacro
For the last two examples above, all the "will"s are displayed and none of the "wont"s are.
Copyright (c) 1998-2006 JASSPA
Last Modified: 2002/01/11
Generated On: 2006/10/07