Wiki source for KeyPgPpundef


Show raw source

{{fbdoc item="title" value="#UNDEF"}}----
Preprocessor directive to undefine a macro

{{fbdoc item="syntax"}}##
**#undef** //symbol//
##
{{fbdoc item="desc"}}
Undefines a symbol previously defined with ##[[KeyPgPpdefine|#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.)

{{fbdoc item="ex"}}
{{fbdoc item="filename" value="examples/manual/prepro/undef.bas"}}%%(freebasic)
#DEFINE ADD2(a_, b_) ((a_) + (b_))
Print ADD2(1, 2)
' Macro no longer needed so get rid of it ...
#UNDEF ADD2
%%

{{fbdoc item="diff"}}
- New to Freebasic

{{fbdoc item="see"}}
- ##[[KeyPgPpdefine|#define]]##
- ##[[KeyPgPpmacro|#macro]]##
- ##[[KeyPgPpif|#if]]##
- ##[[KeyPgPpelse|#else]]##
- ##[[KeyPgPpelseif|#elseif]]##
- ##[[KeyPgPpendif|#endif]]##
- ##[[KeyPgPpifdef|#ifdef]]##
- ##[[KeyPgPpifndef|#ifndef]]##
- ##[[KeyPgDefined|defined]]##

{{fbdoc item="back" value="CatPgPreProcess|Preprocessor"}}
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode