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

Aibo General

Aibo Development

Wiki Help

Aibo Links

R-Code » DO

DO...LOOP Statement

Repeatedly executes the block of statements between DO and LOOP.

When a conditional expression is specified for DO or LOOP, the loop is repeated until one of the conditions is satisfied. If WHILE is specified, the loop continues to execute while the condition is true. If UNTIL is specified, the loop continues to execute until the condition is true.

Note If no condition is specified for either DO or LOOP, the loop repeats infinitely.

Models

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

Syntax

DO[:WHILE|UNTIL:val1:op:val2]
...
LOOP[:WHILE|UNTIL:val1:op:val2]

The DO...LOOP statement syntax has the following parts:

PartDescription
val1Variable or constant.
opA valid boolean operator (=, ==, <>, !=, <, <=, >, >=, &, |, ^, &&, ||).
val2Variable or constant.

Example(s)


   // count upward from 1 to 10
   LET:i:1
   DO:UNTIL:i:>:10
       PRINT:"i=%d":i
       ADD:i:1
   LOOP

   // or
   LET:i:1
   DO:WHILE:i:<:10
      PRINT:"i=%d":i
      ADD:i:1
   LOOP

   // or
   LET:i:1
   DO
      PRINT:"i=%d":i
      ADD:i:1
   LOOP:WHILE:i:<:10
 

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