DIRECTIVEPublished
#ifndef
#ifndef <identificador> ... [#else ...] #endifIncludes a block only when a given identifier is not defined.
Overview
#ifndef is the inverse of #ifdef. It is useful for header guards and defaults: the block remains only when the symbol does not exist at that preprocessing point.
Syntax
#ifndef <identificador> ... [#else ...] #endifProtected default value
#ifndef BANCO_DADOS_PADRAO
#define BANCO_DADOS_PADRAO "MSSQL"
#endif
User Function ExIfNDef()
ConOut("Banco padrão: " + BANCO_DADOS_PADRAO)
ReturnExpected result
MSSQL is defined only when no previous definition is active.
- Use it to provide a default without overriding an earlier definition.
- Always close with #endif.
- Changing a compiled default requires recompilation.
- An undefined symbol is not the same as a false logical value.
