TOC PREV NEXT INDEX

#define, #undef, #ifdef, #else, and #endif

Synopsis

#define symbol
#undef _symbol
#ifdef _symbol
#else
#endif

Description

#define defines a symbol that you can use in an ifdef statement. symbol is an unquoted string.

#undef undefines a previously defined symbol.

#ifdef begins a conditional block of V code. If symbol has been defined at the time the ifdef block is parsed, AVS/Express recognizes the block's code. If symbol has not been defined, AVS/Express ignores it.

#else switches the state of a previous #ifdef.

#endif ends a conditional block of V code.

Examples

The following example contains conditional V statements. One block is recognized only if the symbol unix has been defined; another block only if the symbol windows has been defined. Since the symbol unix has been defined, the first block is recognized:


#define unix

#ifdef unix
... // This code is recognized.
#endif

#ifdef windows
... // This code is ignored unless the
// symbol windows has also been
// defined.

#endif


TOC PREV NEXT INDEX