Skip to content

procedures Else

Paul Squires edited this page Sep 19, 2026 · 1 revision

Home › Preprocessor › #else

#else

Preprocessor conditional directive

Syntax

#if (expression)
' Conditionally included statements if expression is True
#else
' Conditionally included statements if expression is False
#endif

Description

#else can be added to an #if, #ifdef, or #ifndef block to provide an alternate result to the conditional expression.

Remarks

Differences from QB

  • New to FreeBASIC

See also

Examples

#define MODULE_VERSION 1

Dim a As String

#if (MODULE_VERSION > 0)

  a = "Release"

#else

  a = "Beta"

#endif

Print "Program is "; a

Category: Preprocessor
Kind: keyword


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally