On Friday 08 July 2005 10:49, Gerhard Scholz wrote:
> Beside, v is word or byte, depending on a compiler-$if elsewhere, so
> I would have to write:
>
> inc ( {$ifdef big} smallint {$else} shortint {$endif }v, delta ) ;
>
> Not very clear readable.
Agreed. It's not readable at all. So don't do that, instead
{$IFDEF BIG}
type My_Type = SmallInt;
{$ELSE}
type My_Type = ShortInt;
{$ENDIF}
and then
|Inc (My_Type(v), Delta);
should do the trick.
OTOH, to be honest: I don't see the point in using Inc/Dec here at all,
especially if "v := v + Delta;" would work perfect already. I even
think the "standard" way of doing the addition would be much more
readable in that context.
Vinzent.
--
public key: http://www.t-domaingrabbing.ch/publickey.asc
pgplFJ6tp8cLb.pgp
Description: signature
_______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-devel
