please dont rip this site

  DO { WHILE | UNTIL Condition }
    Statement(s)
  LOOP

  DO
    Statement(s)
  LOOP { UNTIL | WHILE Condition }

Function
Create a repeating loop that executes the program lines between DO and LOOP, optionally testing before or after the loop statements.

Explanation
DO...LOOP loops let your program execute a series of instructions indefinitely, or until a specified condition terminates the loop. The simplest form is shown here:

Alarm_On:
  DO
    HIGH Alarm_LED
    PAUSE 500
    LOW Alarm_LED
    PAUSE 500
  LOOP

In this example the alarm LED will flash until the SX is reset. DO...LOOP allows for condition testing before and after the loop statements as show in the examples below.

Alarm_On:
  DO WHILE AlarmStatus = 1
    HIGH Alarm_LED
    PAUSE 500
    LOW Alarm_LED
    PAUSE 500
  LOOP
  RETURN
Alarm_On:
  DO
    HIGH Alarm_LED
    PAUSE 500
    LOW Alarm_LED
    PAUSE 500
  LOOP UNTIL AlarmStatus = 0
  RETURN

When the second form is used the loop statements will run at least once before the condition test.


Related instructions: FOR...NEXT, IF...THEN, and EXIT


file: /Techref/parallax/sxb/sxb/do-loop.htm, 2KB, , updated: 2006/4/10 14:47, local time: 2025/5/20 23:57,
TOP NEW HELP FIND: 
18.219.241.228:LOG IN

 ©2025 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://massmind.ecomorder.com/Techref/parallax/sxb/sxb/do-loop.htm"> DO ... LOOP</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to ecomorder.com!

 

Welcome to massmind.ecomorder.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .