Subject | RE: [IBO] TIB_Column.GetAsExtended and Int64 |
---|---|
Author | Jason Wharton |
Post date | 2006-06-09T18:32:19Z |
I'll take a look at this more closely. It looks to me as though you have
found a bug.
What version of Delphi are you using?
Jason
found a bug.
What version of Delphi are you using?
Jason
> -----Original Message-----
> From: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com]On
> Behalf Of Guido Klapperich
> Sent: Thursday, June 08, 2006 1:02 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] TIB_Column.GetAsExtended and Int64
>
>
> I have a field of the type Numeric(18,0) with the value
> 12345678912345.
> When I select the field, for example in a IB_edit control,
> all is fine,
> the value is displayed. Now I define a display mask for the field like
> ###,###,###,###,###,##0
> and I open my test query again, I get the exception that
> 12345678912345
> is no integer value. I have done debugging and the problem is in the
> unit IB_Components in the function TIB_Column.GetAsExtended: extended;
> Here's the original code:
>
> function TIB_Column.GetAsExtended: extended;
> var
> tmpS: string;
> begin
> tmpS := AsString;
> if tmpS = '' then
> Result := 0
> else
> case SQLType of
> SQL_FLOAT,
> SQL_FLOAT_: Result := AsFloat;
> SQL_DOUBLE,
> SQL_DOUBLE_: Result := AsDouble;
> else
> if SQLScale = 0 then
> Result := StrToInt( tmpS )
> else
> Result := StrToFloat( tmpS );
> end;
> end;
>
> In my case the SQLType is SQL_INT64 and therefore the
> function runs into
> Result := StrToInt( tmpS ) and then gets an error. I have added the
> following code:
>
> SQL_INT64,
> SQL_INT64_: Result := AsInt64;
>
> Now it works fine for me. Is this a bug I should report to
> Jason or am I
> doing something wrong?
>
> Regards
>
> Guido