[fpc-pascal] getlastoserror giving wrong value?

Marc Santhoff M.Santhoff at t-online.de
Thu Dec 27 06:46:31 CET 2007

Am Freitag, den 21.12.2007, 06:37 +0100 schrieb Marc Santhoff:
> How can that happen?

Pretty simple, all occurences of getlastoserror() and the error variable
seem to declare the number as longint. In my program I did the same. The
value given back is only a word - or looks as if it is.

When looking at the hex form of the error number in question things are
getting clear:

longint -65523 = hex FFFF000D

So somewhere the upper word is lost or set to FFFF, when omitting this
part by using word as variable type anything is okay.

I'll try to find out if this is something special coming from the OS or
if it's a compiler issue.

[FreeBSD 4.11, fpc 2.0.4]


More information about the fpc-pascal mailing list