if you assign "-" of a word-Variable to an int64 one, you get unexpectet results:
var aWord:word;
ainteger:integer;
AInt64:int64;
begin
aWord:=2;
aInteger:=2;
AInt64:=-aWord;
writeln(inttostr(AInt64)); //you get 4294967294 instead of -2
AInt64:=0-aWord;
writeln(inttostr(AInt64)); //-2
AInt64:=-int64(aWord);
writeln(inttostr(AInt64)); //-2
AInt64:=-aInteger;
writeln(inttostr(AInt64)); //-2
end.
I suppose this to be a bug in Delphi 6.
Is this still there in Delphi 2007,2008,...?
Regards
M.Malarski
You posted to a group which, on the original server does not exits
anymore. Please be sure to post to the newsgroups.borland.com server,
and not to news.online.de. Hardly anyone will see your post, here (I
only saw it because I was looking for such orphaned groups).
Please post to
news://newsgroups.borland.com/borland.public.delphi.language.delphi.win3
2 instead (careful for the wrap).
--
Rudy Velthuis http://rvelthuis.de
"Imitation is the sincerest form of television."
-- Fred Allen (1894-1956)