Difference between revisions of "$ELSE"

From QB64.org wiki
Jump to: navigation, search
(Created page with ''''$ELSE''' is precompiler command, which determines which sections of code inside its blocks are included into our code for compiling. {{PageSyntax}} :: $IF variable = express…')
 
(Redirected page to $IF)
 
Line 1: Line 1:
'''$ELSE''' is precompiler command, which determines which sections of code inside its blocks are included into our code for compiling.
+
#REDIRECT [[$IF]]
 
 
 
 
{{PageSyntax}}
 
:: $IF variable = expression THEN...
 
::.
 
:: $ELSE
 
::.
 
:: $END IF
 
 
 
* $ELSE must follow a valid $IF statement
 
* There can only be one $ELSE in an $IF-$ELSEIF-$ELSE-$END IF block, and it must be the last block selection before the $END IF.  $ELSEIF ''can not'' follow $ELSE.
 
 
 
 
 
''Example 1:''
 
{{CodeStart}} '' ''
 
{{Cl|$IF}} WIN THEN
 
    {{Cl|CONST}} Slash = "\"
 
{{Cl|$ELSE}}
 
    {{Cl|CONST}} Slash = "/"
 
{{Cl|$END IF}}
 
 
 
{{Cl|PRINT}} "The proper slash for your operating system is "; Slash
 
{{CodeEnd}}
 
 
 
For the above, the CONST slash is defined by the automatic internal flag (WIN), which tells us what operating system we're using.  On a windows PC, the Slash will be the backslash; for any other OS it will be the forward slash.
 
 
 
 
 
''See also:''
 
* [[$LET]]
 
* [[$IF]]
 
* [[$ELSEIF]]
 
* [[$END IF]]
 
 
 
{{PageNavigation}}
 

Latest revision as of 19:16, 5 September 2017

Redirect to: