EndIf
If [Expression=true] ..Run This Code .. EndIf
 
Parameters: NONE
Returns: NONE
 

     EndIf is used in combination with the conditional If statement. If performs a comparison of an expression, if the expression resolves to be true(euals 1), the code following the If statement and between the EndIf statements will be executed. If not, then the code between the If-EndIf will be ignored. Allowing our programs to make decisions.

      For more information on If/EndIf statements please refer to the If page.




FACTS:


      * If / EndIf statements don't require the Then statement.




Mini Tutorial:


      Display a message If a value is higher than 50

  
; Compare a random number with 50 and display a message IF that value
; is greater than 50..  if not.. nothing will be displayed
  
  If  Rnd(100> 50
     Print "This random value is  greater than 50"
  EndIf
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




 
Related Info: Else | ElseIf | If | Select | Then :
 


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