$ELSE

From QB64.org wiki
Revision as of 14:25, 18 August 2015 by SMcNeill (talk) (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…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

$ELSE is precompiler command, which determines which sections of code inside its blocks are included into our code for compiling.


Contents

Syntax

$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:

$IF WIN THEN CONST Slash = "\" $ELSE CONST Slash = "/" $END IF PRINT "The proper slash for your operating system is "; Slash

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:



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