Skip to content

#UNDEF


Preprocessor directive to undefine a macro

Syntax

` #undef symbol

`

Description

Undefines a symbol previously defined with #define.

Can be used to ensure that a macro or symbol has a limited lifespan and does not conflict with a similar macro definition that may be defined later in the source code.

(Note: #undef should not be used to undefine variable or function names used in the current function scope. The names are needed internally by the compiler and removing them can cause strange and unexpected results.)

Examples

start GeSHi

vb
#DEFINE ADD2(a_, b_)  ((a_) + (b_))
Print ADD2(1, 2)
' Macro no longer needed so get rid of it ...
#UNDEF ADD2

end GeSHi

Differences from QB

  • New to Freebasic

See also

  • #define
  • #macro
  • #if
  • #else
  • #elseif
  • #elseifdef
  • #elseifndef
  • #endif
  • #ifdef
  • #ifndef
  • 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