#IF
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgPpif
- Last revised: 2023-10-02
Preprocessor conditional directive
Syntax
vb
#if (expression)
' Conditionally included statements
#endifDescription
Conditionally includes statements at compile time.
Statements contained within the #if / #endif block are included if expression evaluates to True (non-zero) and excluded (ignored) if expression evaluates to False (0).
This conditional directive differs from the If conditional statement in that #if is evaluated at compile-time and If is evaluated at run-time.
Examples
start GeSHi
vb
#define DEBUG_LEVEL 1
#IF (DEBUG_LEVEL >= 2)
' This line is not compiled since the expression is False
Print "Starting application"
#ENDIFend GeSHi
Differences from QB
- New to FreeBASIC
See also
#define#macro#else#elseif#elseifdef#elseifndef#endif#ifdef#ifndef#undefdefined#assert
Back to DocToc