"Bill Schwab" <
[hidden email]> wrote in message
news:aj8t95$1898qu$
[hidden email]...
> Hi Blair,
>
> Try
>
> FILETIME fromInteger:126661379535479952.
>
> It looks like D4 was truncating the large integer argument where D5 does
> not. If I'm reading it correctly, the D5 behavior seems better, but some
> kind of patch to FILETIME is required.
Thanks Bill, recorded and fixed (for next release) as #1039.
>
> As MS would put it, "the following has not been fully regression tested,
and
> should be installed only if you are..." :)
>...
A suitable test, passing a range of inputs including boundary conditions
such as 0, 1, (2^32)-1, 2^32, (2^32)+1, (2^64)-1, and 2^64 (an error), might
be:
self assert: (FILETIME fromInteger: anInteger) asInteger = (anInteger
bitAnd: 2 ** 64 - 1)
Negative inputs should probably be an error, but as they aren't currently
the test allows for this.
>
> fromInteger: int64
> ^self new
> dwLowDateTime:( int64 bitAnd:16rFFFF );
> dwHighDateTime: (int64 bitShift: -32)
BTW: That bit mask should be (2^32)-1, i.e. 16rFFFFFFFF.
Regards
Blair