[fpc-devel] Use of (* comment for $DEFINEd macros

Paul Robinson paul at paul-robinson.us
Thu Jan 19 21:49:27 CET 2012


From: Felipe Monteiro de Carvalho <felipemonteiro.carvalho at gmail.com>


On Thu, Jan 19, 2012 at 8:04 PM, Paul Robinson <paul at paul-robinson.us> wrote:
> --- Second Example ---
> {$MACRO ON }
> {*$DEFINE XX1:=' This is from Macro1' *)

This is wrong code. You cannot open a comment with { and close it with *)

I may have misread the brace when I typed it, but this one I checked Line 6 three times to ensure the comment opens with (* and closes with *)

{$MACRO ON }
{$DEFINE XX1:=' This is from Macro1' }
{$DEFINE XX2:=' This is from Macro2' }
{$DEFINE XX3:=' This is from Macro3' }

(*$DEFINE XX1:=' This is from Macro1A' *)
{$DEFINE XX2:=' This is from Macro2A' }
{$DEFINE XX3:=' This is from Macro3A' }



Begin
    writeln('*EXAMPLES*');
    Writeln('M1: ', XX1);
    writeln('M2: ', XX2);
    writeln('M3: ', XX3);
    writeln('*END EXAMPLES');
    readln;
end.

And again, it tells me the source code terminates prematurely.




More information about the fpc-devel mailing list