Else
If [Expression=true] ..Run This Code Else Run that code .... Endif
 
Parameters: NONE
Returns: NONE
 
     Else is used in combination with the conditional If / EndIf statements. If performs a comparison of an expression, if the expression resolves to be true, the code following the If statement and between the Else statements will be executed. If not, then the code between the Else-Endif statements will be executed.

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


FACTS:


      * If / Else / EndIf statements don't require Then.




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.. or lower than or equal to 50.
  Number = Rnd(100)
  
  Print Number
  
  If  Number > 50
     Print "This random value is greater than 50"
  Else
     Print "this random value is equal to 50 or lower"
  EndIf
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  




 
Related Info: ElseIf | EndIf | If :
 


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