ExitDo
ExitDo
 
Parameters: NONE
Returns: NONE
 

      ExitDo will force PlayBASIC to break out of the current Do-Loop that is being executed.



FACTS:


      * Only Works within Do-Loop or Do-DecLoop Structures.

      * When an command is executed, PlayBASIC will about the loop and continue executing code after the Loop or DecLoop statement.



Mini Tutorial:


      Breaking free of Do-Loop when a condition is met.

  
  
; Set the Start of the Do-Loop structure.
  Do
   ; Display the count variable to the screen.
     Print Count
     
   ; Add 1 to the Counter Variable
     Count=Count+1
     
   ; Check if the count variable is equal to or greater than 10
   ; if so, then tell PlayBASIC to exit this DO-LOOP..
     If Count => 10 Then ExitDo
     
   ; Display the Screen and LOOP back to the DO command.
     Sync
  Loop
  
  Print "program as ended.."
  
; display the screen and wait for a key to be pressed
  Sync
  WaitKey
  
  



This example would output.

  
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
  This program has ended..
  

 
Related Info: Continue | DecLoop | Do | Exit | Goto | Loop :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com