[fpc-pascal] wiki page confusion with Ordinal to Word conversion
Jonas Maebe
jonas.maebe at elis.ugent.be
Fri Mar 11 12:14:25 CET 2011
On 11 Mar 2011, at 11:41, Ben wrote:
> Based on this wiki description, If a value of Ord(True) is assigned to say a Word variable, the value of that Word variable is now -1. How is that possible when the Word type has a valid range of only 0..65535??
byte/word/long/qwordbool is used as a shorthand for bytebool, wordbool, longbool, qwordbool. Try this:
program test;
var
w: word;
bo: wordbool;
begin
bo := True;
w := ord(bo);
writeln(w);
end.
Jonas
More information about the fpc-pascal
mailing list