Conditional compiling:  


Conditional compiling

Conditional compiling allows you to turn compiling on or off from within your program depending on the environment the program is being compiled for.

Conditional compiling works a bit like an If statement, but takes the form:

?Identifier

The ? must appear at the start of a new line, and Identifier should be one of the following:

NameMeaning
DebugTrue if program is being compiled in debug mode.
ThreadedTrue if program is being compiled in threaded mode.
Win32True if program is being compiled for the Windows operating system.
MacOSTrue if program is being compiled for the MacOS operating system.
LinuxTrue if program is being compiled for the Linux operating system.
X86True if program is being compiled for the Intel CPU.
PPCTrue if program is being compiled for the PowerPC CPU.
MacOSX86True if program is being compiled for an Intel Mac.
MacOSPPCTrue if program is being compiled for a PowerPC Mac.
BigEndianTrue if program is being compiled for a big endian CPU.
LittleEndianTrue if program is being compiled for a little endian CPU.

Identifier may also be preceded by Not to invert the result.

An ? on its own always turns compiling on.

For example:

?Debug
	'Any code here is only compiled in debug mode.
?Not Debug
	'Any code here is only compiled in release mode.
?
	'Code here is always compiled.