Bonjour !
Passant de Turbo-Pascal à Free-Pascal, je découvre les possibilités offertes par ce dernier.
Ainsi je voudrais bien utiliser le type ByteBool, mais le code que j'essaie ne marche pas.
Le compilateur me fait savoir qu'il a trouvé un "ShortInt" là où il s'attendait à un "ByteBool".Code:
1
2
3
4 var bb: ByteBool; begin bb := 1; end.
En relisant le manuel, je ne vois toujours pas mon erreur.
Citation:
Free Pascal also supports the ByteBool, WordBool and LongBool types. These are of type Byte, Word or Longint, but are assignment compatible with a Boolean: the value False is equivalent to 0 (zero) and any nonzero value is considered True when converting to a boolean value.