Skip to content

#ELSEIFDEF


Preprocessor conditional directive

Syntax

vb
#ifdef A

' Conditionally included statements if A is defined

#elseifdef B

' Conditionally included statements if A is not defined and B is defined

#else

' Conditionally included statements if both A and B are not defined

#endif

Description

#elseifdef can be added to an #if block to provide an additional condition.

#elseifdef symbol is equivalent to #elseif defined (symbol)

Examples

start GeSHi

vb
#DEFINE B

#IFDEF A
    Print "A is defined"
#ELSEIFDEF B
    Print "A is not defined and B is defined"
#ELSE
    Print "both A and B are not defined"
#ENDIF

end GeSHi

Version

  • Since fbc 1.20.0

Differences from QB

  • New to Freebasic

See also

  • #define
  • #macro
  • #if
  • #else
  • #elseif
  • #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