<p>Am 15.07.2015 08:21 schrieb "ulrich" <<a href="mailto:romrum@cbox.cz">romrum@cbox.cz</a>>:<br>
><br>
> Hi,<br>
><br>
> I have this unit, but when I compile it, I get this error:<br>
><br>
> Illegal unit name XXX_Parser. The unit is saved under dfm_rrparser.pas.<br>
><br>
> Second question:<br>
><br>
> Why not displayed $INFO directive in the message window (I have enabled -vi switch in command line)?<br>
><br>
><br>
> {$IFDEF FPC}<br>
> {$MACRO ON}<br>
> {$IFNDEF XXX_}<br>
> {$DEFINE XXX_:=DFM_RR} // replace prefix<br>
> {$ENDIF}<br>
> {$ENDIF}<br>
><br>
> {$INFO compiled with XXX_}<br>
><br>
> unit XXX_parser;<br>
><br>
> {$mode objfpc}{$H+}<br>
><br>
> interface<br>
><br>
> implementation<br>
><br>
> end.</p>
<p>Macros are only expanded on whole tokens (aka words). So XXX_ is expanded, but XXX_parser is not. It's the same with C preprocessors by the way.</p>
<p>Regards,<br>
Sven</p>