Difference between revisions of "$ELSEIF"

From QB64.org wiki
Jump to: navigation, search
(Created page with ''''$ELSEIF''' is precompiler command, which determines which sections of code inside its blocks are included into our code for compiling. {{PageSyntax}} :: $IF variable = expre…')
 
(style guidelines; resolution of multiple pages into one.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''$ELSEIF''' 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...
 
::.
 
::.$ELSEIF variable = expression THEN...
 
::.
 
:: $ELSE
 
::.
 
:: $END IF
 
 
 
* $ELSEIF must follow a valid $IF or $ELSEIF statement.
 
* If $ELSE is used, it must be used as the last conditional check before $END IF.  $ELSEIF ''can non'' come after $ELSE.
 
 
 
''Example 1:''
 
{{CodeStart}} '' ''
 
{{Cl|$IF}} WIN AND 32Bit THEN
 
    {{Cl|CONST}} Slash = "\"
 
    {{Cl|CONST}} OS = "Windows 32Bit"
 
{{Cl|$ELSEIF}} WIN AND 64Bit THEN
 
    {{Cl|CONST}} Slash = "\"
 
    {{Cl|CONST}} OS = "Windows 64Bit"
 
{{Cl|$ELSEIF}} 32Bit THEN
 
    {{Cl|CONST}} Slash = "\"
 
    {{Cl|CONST}} OS = "Non-Windows 32Bit"
 
{{Cl|$ELSE}}
 
    {{Cl|CONST}} Slash = "/"
 
    {{Cl|CONST}} OS = "Non-Windows 64Bit"
 
{{Cl|$END IF}}
 
 
 
{{Cl|PRINT}} "The proper slash for your operating system is "; Slash; " and you're running on a "; OS; " operating system."
 
{{CodeEnd}}
 
 
 
 
 
 
 
''See also:''
 
* [[$LET]]
 
* [[$IF]]
 
* [[$ELSE]]
 
* [[$END IF]]
 
 
 
{{PageNavigation}}
 

Latest revision as of 19:37, 5 September 2017

Redirect to: