Skip to content

#ELSE


Preprocessor conditional directive

Syntax

vb
#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.

Examples

start GeSHi

vb
#DEFINE MODULE_VERSION 1
Dim a As String
#IF (MODULE_VERSION > 0)
  a = "Release"
#ELSE
  a = "Beta"
#ENDIF
Print "Program is "; a

end GeSHi

Differences from QB

  • New to FreeBASIC

See also

  • #define
  • #macro
  • #if
  • #elseif
  • #elseifdef
  • #elseifndef
  • #endif
  • #ifdef
  • #ifndef
  • #undef
  • defined

Back to DocToc

Translated from FreeBASIC official docs. Contact us for removal if infringed.
FreeBASIC is an open-source project, not affiliated with Microsoft