# !return(4)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

!return, !abort - Exit macro

## SYNOPSIS

!return [n]
!abort [n]

## DESCRIPTION

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.

## EXAMPLE

The following example checks the current language and warns if it has not be set, i.e. `Default`.

    ;	Check the current language

    !if &not &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.

## SEE ALSO

define-macro(2), !bell(4), !if(4), !goto(4).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>