[fpc-pascal] undefining multiple defines

Marc Santhoff M.Santhoff at t-online.de
Sun Mar 6 23:52:23 CET 2005


Am So, den 06.03.2005 schrieb Olle Raab um 23:30:
> 05-03-03 10.55, skrev Marc Santhoff följande:
> 
> > Am Do, den 03.03.2005 schrieb Marco van de Voort um 08:32:
> >>> unit b;
> >>> ...
> >>> {$undef M1-M15}
> >> 
> >> Such constructs won't work, for the same reason that variablenames with
> >> numbers in it can't be used as such.
> >> 
> >> For the compiler it is an alphanumerical identifier, and the number(s) have
> >> no meaning.
> > 
> > According to the Programmers Guide MACPAS-Mode alows to use $SETC M=8
> > and I assume that "$if M=8" can check it.
> 
> In MACPAS it would be "$IFC M=8" but otherwise you are correct.
> 
> > Unfortunately my program is compiled with -S2 and I fear these two modes
> > are no combinable (I'll test later), are they?
> 
> No, sorry.

Pretty evident.

> You can however define a macro, afaik:
> 
> {$DEFINE M := 8}
> 
> To get this work you then have to turn macros on in the unit, and live with
> that:
> 
> {$MACRO ON}

Yes, I was thinking about a solution using macros, but had some other
work to do. And  can live with macros on very well (I think before
trying ;), the most rememberable and easy to use solution is welcome
here.

Thanks,
Marc






More information about the fpc-pascal mailing list