HPlogo System Debug Reference Manual > Chapter 6 System Debug Command Specifications M-X

RET[URN]

MPE documents

Complete PDF
Table of Contents
Index

E0201 Edition 4 ♥
E0300 Edition 3
E0692 Edition 3

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




RESTORE


SET