Hi all. Very odd, I got three replicate answers to the above.
But thanks for advice understood - since the answer is not accurate, it
generates an error. In this case the answer is accurate enough.

Example was too brief:
  s: longint;
  DTnum: int64;
begin
    DTnum := int64(datetimetotimestamp(now));
    S := round(DTnum / 10000); //about every 20 seconds



Tuesday, December 9, 2003, 2:50:46 PM, you wrote:
KH> While it may work if range checking is off it does not mean that the
KH> value returned will be accurate.

KH> Round returns an int64 which has a higher range than longint. When you
KH> assign result to s with rangecheck off and the result is + or - beyond
KH> the range of longint you are going to get a value inside longint range
KH> rather than the required result value.

KH> Ie

KH> sI:Smallint (-126 -- +127)
KH> B:byte;

KH> B := 128;
KH> Si := b;


_______________________________________________
Delphi mailing list
[EMAIL PROTECTED]
http://ns3.123.co.nz/mailman/listinfo/delphi

Reply via email to