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

Home › Preprocessor › #ifdef

#ifdef

Preprocessor conditional directive

Syntax

#ifdef symbol
' Conditionally included statements
#endif

Description

Conditionally includes statements at compile time.

Statements within the #ifdef...#endif block are included if symbol is defined and excluded (ignored) if symbol is not defined.

#ifdef symbol is equivalent to #if defined (symbol)

Remarks

Differences from QB

  • New to Freebasic

See also

Examples

#define _DEBUG

#ifdef _DEBUG

    ' Special statements for debugging

#endif

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