[fpc-pascal] Boolean types

Sven Barth pascaldragon at googlemail.com
Fri Jan 3 10:35:23 CET 2014


Am 03.01.2014 09:59 schrieb "Mark Morgan Lloyd" <
markMLl.fpc-pascal at telemetry.co.uk>:
>
> What is assignment-compatible with a bytebool etc.?

True, False and a Boolean variable of any other of the Boolean types.

>
> My reading of the manual suggested that it should be possible to assign
numeric zero or non-zero, but
>
> fPB1L: bytebool;
> ..
> fPB1L := 0;
>
> b5500centralcontrol.pas(119,18) Error: Incompatible types: got "ShortInt"
expected "ByteBool"

You need to cast nevertheless. It's just that they can be used in place of
e.g. BOOL parameters for WinAPI functions whereby the argument value is
passed like the underlying non-Boolean datatype.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140103/7f92a44f/attachment.html>


More information about the fpc-pascal mailing list