Smart pascal source code
if ConditionalDefined('ALPHA') then
WriteLn('ALPHA 1');
if ConditionalDefined('BETA') then
WriteLn('BETA 1');
{$IF Defined('ALPHA')}
WriteLn('Alpha defined');
{$ELSE}
WriteLn('Alpha not defined');
{$ENDIF}
{$DEFINE ALPHA}
{$IF Defined('ALPHA')}
WriteLn('Alpha defined');
{$ELSE}
WriteLn('Alpha not defined');
{$ENDIF}
if ConditionalDefined('ALPHA') then
WriteLn('ALPHA 2');
if ConditionalDefined('BETA') then
WriteLn('BETA 2');
{$DEFINE BETA}
if ConditionalDefined('ALPHA') then
WriteLn('ALPHA 3');
if ConditionalDefined('BETA') then
WriteLn('BETA 3');
{$UNDEF ALPHA}
if ConditionalDefined('ALPHA') then
WriteLn('ALPHA 4');
if ConditionalDefined('BETA') then
WriteLn('BETA 4');
{$IF Defined('ALPHA')}
WriteLn('Alpha defined');
{$ELSE}
WriteLn('Alpha not defined');
{$ENDIF}
{ <<<<<<<<<<<< CONSOLE OUTPUTS >>>>>>>>>>>>>>>>>>>
Alpha not defined
Alpha defined
Alpha not defined
}
if (($ConditionalDefines.indexOf("ALPHA")!=-1)) {
WriteLn("ALPHA 1");
}
if (($ConditionalDefines.indexOf("BETA")!=-1)) {
WriteLn("BETA 1");
}
WriteLn("Alpha not defined");
WriteLn("Alpha defined");
if (($ConditionalDefines.indexOf("ALPHA")!=-1)) {
WriteLn("ALPHA 2");
}
if (($ConditionalDefines.indexOf("BETA")!=-1)) {
WriteLn("BETA 2");
}
if (($ConditionalDefines.indexOf("ALPHA")!=-1)) {
WriteLn("ALPHA 3");
}
if (($ConditionalDefines.indexOf("BETA")!=-1)) {
WriteLn("BETA 3");
}
if (($ConditionalDefines.indexOf("ALPHA")!=-1)) {
WriteLn("ALPHA 4");
}
if (($ConditionalDefines.indexOf("BETA")!=-1)) {
WriteLn("BETA 4");
}
WriteLn("Alpha not defined");