HP 3000 Manuals

RET[URN] [ System Debug Reference Manual ] MPE/iX 5.0 Documentation


System Debug Reference Manual

RET[URN] 

Exits from a macro, optionally returning a specified value.

Syntax 

     RET[URN] [value]

The RETURN command can be used only within a macro.

When the RETURN command is encountered, a value is returned, and the
macro execution is immediately terminated.  Additional commands within
the macro that follows an executed RETURN command are never executed.

Parameters 

 value           The value to be returned by the macro.  If value is not
                 specified, the default macro return value is returned.

Examples 

     $nmdebug > macro test=$123 (p1) {if p1 < 10 then return p1 else ret} 
     $nmdebug > wl test(3) 
     $3
     $nmdebug > wl test(45) 
     $123

A macro named test is defined with a default return value of $123.

When the macro is called with the parameter of 3, the parameter is less
than $10, so the parameter value is returned.

In the second call, because $45 is larger than 10, the default macro
return value $123 is returned.

     $nmdebug > return 33 
     The RETURN command must be used within a macro body.  (error #1449)

The RETURN command can be used only within a macro.

Limitations, Restrictions 

none


CAUTION The output format of all System Debug commands is subject to change without notice. Programs that are developed to postprocess System Debug output should not depend on the exact format (spacing, alignment, number of lines, uppercase or lowercase, or spelling) of any System Debug command output.


MPE/iX 5.0 Documentation