Subject Re: [IBO] TIBOQuery, NUMERIC(15,4), BCD field, Invalid point operation...?
Author Jason Wharton
What happens if the _TrimExt() in IBODataset.pas is just commented out?
I cannot recall exactly why someone wanted that there. Apparently there was
some junk bleeding into significant digit places somehow. I never actually
saw it happening myself but that assembler patch was supposed to correct
that.

Will someone look this over and tell me if they see why it could be doing
what it is?
Could it be that the binary handling of the extended type is dependant upon
the version of Delphi?

function _TrimExt(e: extended): extended;
const
CorrFactor: Longint = 100000000;
CW: word = $1332; file://same as system.Default8087CW
var
PlaceFor64Bit: packed array [0..1] of longint;
asm
fldcw word ptr [CW] file://reset control word if modified to default
fld tbyte ptr [e] file://load function param to ST
fimul dword ptr [CorrFactor] file://mult ST with CorrFactor, result stored
in ST
fistp qword ptr [PlaceFor64Bit]//int store with rnd rslt to PFor64Bit &
clr ST
fwait
fild qword ptr [PlaceFor64Bit] file://load integer result of fmul into ST
fidiv dword ptr [CorrFactor] file://divide by CorrFactor, result stored
in ST
fstp tbyte ptr [Result] file://store result into funtions Result and
clear ST
fwait
end;

Looks to me like it must blow the space allocated to it somehow.

Thanks,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: <matroia@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, October 25, 2001 6:43 PM
Subject: Re: [IBO] TIBOQuery, NUMERIC(15,4), BCD field, Invalid point
operation...?


> I haven't seen this problem so there is something unique about your
> situation I think I need to see.
> What number are you trying to store in it?
>
> Jason Wharton


Thanks, for your prompt answer, i digged the problem a little more
and found out the following:

We Tested the same database using TIB_Query and respective components
and i'am able to store a very huge number, then on the same form i
tried (isolating from my app) the TIBOQuery with respective standard
DB components and every time i try to edit a value with 8 digits it
blows, it accepts 7 digit values, but not higher than that, i
commented the _TrimExt() call and its working. But since i can't
figure it out i would appreciate your help, i haven´t tried on a new
database, but i will try to assemble a demo with the problem if you
would like to see.

Thanks one more time,
Manuel Tróia