Also:
{$IFNDEF BLUE AND $IFNDEF RED} WriteLn('not Blue nor Red'); {$ELSE} WriteLn('Blue or Red'); {$ENDIF}
<cut>Thanks Thaddy, that is helpful.
The {$IFDEF / $IFNDEF} syntax is not meant to support complex compound syntax without nesting.
[edit]
<cut>
As I recall just now everything after the first name is assumed a comment.You probably have seen this style used in some libraries to document nested defines, mostly on the {$endif a comment} parts.
program untitled; {.$define red} {$define blue} begin {$ifdef red or $ifdef blue} // everything after red is a comment writeln ('read or blue'); {$endif red or blue} // everything after red is a comment. end.
{$IFDEF BLUE} {$DEFINE BLUE_OR_RED} {$ENDIF}
{$IFDEF RED} {$DEFINE BLUE_OR_RED} {$ENDIF}
//...
{$IFDEF BLUE_OR_RED}
//...
{$ENDIF}
Dunno if that falls under your 'without "helper" conditions' condition...I do consider the additional definitions as "helpers" but I still appreciate your suggestion. Thank you.
Looking on the bright side, when Big Chimp and I added to the original wiki entry, it was almost impossible to find anything on the subject. Now we will have an expert update. Thanks Thaddy.I appreciate the effort, but code in the wiki should be tested before adding it. And that was not the case.
It is great to see things improving. Perhaps you could give a full example for comparison, but would the irrelevant parts not be removed by most programmers?I am currently writing and testing complete examples like:
The Free Pascal Programmers' Guide is here: https://freepascal.org/docs-html/prog/prog.html#progch1.html (https://freepascal.org/docs-html/prog/prog.html#progch1.html)Yes, but the *fix* is in the documentation sources for the FPC 3.2.0 programmers guide and not yet on-line! You have to build the new documentation yourself for now, until 3.2.0 is released.