Recent Changes - Search:
Email iofreak@yahoo.com with comments and/or suggestions.

Aibo General

Aibo Development

Wiki Help

Aibo Links

R-Code » RETURN

RETURN Statement

Return from a CALLed subroutine label.

Note A return value can be specified, the return value is retrieved by the caller by using POP.

Models

ERS-210 ERS-220 ERS-31x ERS-7

Syntax

RETURN[:val]

The RETURN statement syntax has the following parts:

PartDescription
valOptional. The user defined variable name or constant value to return.

Example(s)


   LOCAL:x
   LET:x:0 // x = 0

   CALL:MySub
   PRINT:"x = %d":x // x is still zero
   CALL:MyFunc
   POP:x
   PRINT:"x = %d":x // x is now 100
   ...

:MySub
      PRINT:"This is a subroutine."
      RETURN

:MyFunc
      PRINT:"This is a function."
      RETURN:100
 

Remarks

If a subroutine specifies a return value, the caller MUST use POP to clear the returned value off the stack (even if it's not used).

Edit - History - Print - Recent Changes - Search - Site Terms of Use
Page last modified on February 11, 2006, at 05:56 PM CST