home *** CD-ROM | disk | FTP | other *** search
- ///////////////////////////////////////////////////////////////////////
- //
- // Examples of how to utilize WHILE/BREAK/CONTINUE/LOOP.
- //
- ///////////////////////////////////////////////////////////////////////
-
-
- ///////////////////////////////////////////////////////////////////////
- // WHILE/LOOP combination
-
- // set variable 0 to 1 (specify two digits for comparison with 10)
- DEFINE %0 01
-
- // contine exection until %0 is not less than 10
- WHILE %0<10
-
- // display a message to the console command
- ECHO %0 is less than 10
-
- // increment %0 by 1
- DEFINE %0 %0+=1
-
- LOOP
-
-
- ///////////////////////////////////////////////////////////////////////
- // WHILE NOT/LOOP combination
-
- // set variable 0 to 20
- DEFINE %0 20
-
- // contine exection if %0 is not equal to 10
- WHILE NOT %0==10
-
- // display a message to the console command
- ECHO %0 is not equal to 10
-
- // decrement %0 by 1
- DEFINE %0 %0-=1
-
- LOOP
-
-
- ///////////////////////////////////////////////////////////////////////
- // using the BREAK command
-
- // set variable 0 to 1
- DEFINE %0 01
-
- // contine exection if %0 is less than 10
- WHILE %0<10
-
- // display a message to the console command
- ECHO %0 is less than 10
-
- // increment %0 by 1
- DEFINE %0 %0+=1
-
- // if %0 is equal to 5 break out of loop
- IF %0==5 THEN BREAK
-
- LOOP
-
-
- ///////////////////////////////////////////////////////////////////////
- // using the CONTINUE command
-
- // set variable 0 to 1 (specify two digits for comparison with 10)
- DEFINE %0 01
-
- // contine execution if %0 is less than 10
- WHILE NOT %0<10
-
- // display a message to the console command
- ECHO %0 is less than 10
-
- // increment %0 by 1
- DEFINE %0 %0+=1
-
- // if %0 is greater than 5 then bypass the next ECHO
- IF %0>5 THEN CONTINUE
-
- // display another message
- ECHO %0 is less than 5
-
- LOOP
-