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

Aibo General

Aibo Development

Wiki Help

Aibo Links

R-Code » ONCALL

ONCALL Statement

Registers/cancels an interrupt processing routine. An interrupt routine is called when the specified condition statement is met. Conditional specification methods are the same as IF.

Models

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

Syntax

ONCALL:val1:op:val2:label[:resume type:resume label]

ONCALL:-number

The ONCALL statement syntax has the following parts:

PartDescription
val1Variable or constant.
opA valid boolean operator (=, ==, <>, !=, <, <=, >, >=, &, |, ^, &&, || ).
val2Variable or constant.
labelSubroutine label.
resume typeOptional. Resume Type:
0 - Return to statement that generated the interrupt.
1 - After returning to the statement that generated the interrupt, goto resume label.
2 - Return to location of ONCALL statement.
3 - After returning to the location of the ONCALL statement, goto resume label.
4 - Return to the beginning of the program (entire stack is cleared).
5 - After returning to beginning of program, goto resume label.
resume labelOptional. Subroutine label.
numberWhen specified, cancels the last number ONCALLs that have been registered. Must be a negative number.

In 2 - 5, above, all previous ONCALL registrations after the corresponding ONCALL are deleted. In the case of 3 and 5, however, ONCALL commands registered at the same level as the return position are preserved.

Example(s)


   ONCALL:Batt_Rest:<:50:DoSomething

   WHILE:1:==:1
      // Rest of program
      ...
   WEND

:DoSomething
    PRINT:"50% Battery Power Remaining (or less)"
    RESUME
 

Remarks

Once the interrupt is registered, the conditional is evaluated after each subsequent line in the program executes. Nested interrupts are not allowed and are ignored. ONCALL is affected by the subroutine's nesting. An ONCALL registered in a subroutine becomes invalid when execution leaves that subroutine.

Edit - History - Print - Recent Changes - Search - Site Terms of Use
Page last modified on February 10, 2006, at 09:21 PM CST