User Tools

Site Tools


CIGAL Reference Manual, Chapter 2 (Commands): RETURN

RETURN -- Terminate a CIGAL macro program or subroutine

usage: return [Return_value]

RETURN causes the current macro routine to terminate. Control is returned to the calling routine. If the current routine was called interactively then control is returned to the interactive level. RETURN has no effect if called outside of a macro program.

If RETURN_VALUE is specified then this value is stored in register 0 (data variable '#0') and is available to the calling routine.

NOTE: Many other commands also modify the value of #0, so if the calling routine is interested in the return value it should be checked immediately after completion of the macro. For example, if the macro named TESTMACRO returns -1 on an error condition then this could be tested in the calling macro program as:

                testmacro 1 2 3
                if(#0 < 0) {
                        type "error in routine TESTMACRO"

See Also:

CIGAL Home, CIGAL Manual, Commands List, Manual Help

jvs/cigal/manual/chapter2/return.txt · Last modified: 2023/02/23 18:43 (external edit)