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…')
 
Line 1: Line 1:
'''$ELSEIF''' is precompiler command, which determines which sections of code inside its blocks are included into our code for compiling.
+
'''$ELSEIF''' is precompiler command, which determines which sections of code inside its blocks are included into the final code for compiling.
  
  
Line 12: Line 12:
  
 
* $ELSEIF must follow a valid $IF or $ELSEIF statement.
 
* $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.
+
* If $ELSE is used, it must be used as the last conditional check before $END IF.  $ELSEIF cannot come after $ELSE.
  
 
''Example 1:''  
 
''Example 1:''  

Revision as of 02:00, 31 August 2017

$ELSEIF is precompiler command, which determines which sections of code inside its blocks are included into the final code for compiling.


Contents

Syntax

$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 cannot come after $ELSE.

Example 1:

$IF WIN AND 32Bit THEN CONST Slash = "\" CONST OS = "Windows 32Bit" $ELSEIF WIN AND 64Bit THEN CONST Slash = "\" CONST OS = "Windows 64Bit" $ELSEIF 32Bit THEN CONST Slash = "\" CONST OS = "Non-Windows 32Bit" $ELSE CONST Slash = "/" CONST OS = "Non-Windows 64Bit" $END IF PRINT "The proper slash for your operating system is "; Slash; " and you're running on a "; OS; " operating system."


See also:



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page