Subject | Re: [IBO] TIB_ColumnInteger.SetAsString is blocking exceptions from being raised |
---|---|
Author | Jason Wharton |
Post date | 2002-11-22T23:43:20Z |
Look like there is something here I need to take a closer look into. I've
logged this in my Bugs folder.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
logged this in my Bugs folder.
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
-- We may not have it all together --
-- But together we have it all --
----- Original Message -----
From: "geraldo_ls" <precisa@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, November 21, 2002 4:09 AM
Subject: [IBO] TIB_ColumnInteger.SetAsString is blocking exceptions from
being raised
> Hi,
>
> I started to use IBO 4 and think I encountered a bug. I wrote an
> TIB_Query.OnValidateField to validate an Integer field. Delphi was
> stopping on language exceptions, so the exception that my code raised
> was intercepted by delphi, but when I pressed F9 the exception was
> not presented to the user.
>
> I followed the code and discovered that the following piece of
> TIB_ColumnInteger.SetAsString is blocking exceptions from being
> raised:
>
> procedure TIB_ColumnInteger.SetAsString( const NewValue: string );
> var
> tmpVal: string;
> begin
> .
> .
> .
> try
> Value := StrToInt( tmpVal );
> except
> // In Delphi 3 it doesn't seem to know how to reciprocate the
> value.
> if IntToStr( Low( integer )) = tmpVal then
> Value := Low( integer );
> end;
> end;
>
> Note that the try except block doesn't re-raise the exception.
>
> I've looked at TIB_ColumnNumeric.SetAsString methods in the
> IBA_Column.IMP and It has a try except block this way :
> try
> assign the value
> except
> on This:
> Manage;
> on That;
> Manage
> else raise;
> end;
> I've looked TIB_ColumnInteger.SetAsString in IBO 3.6 and the code
> doesn't have the "try except without raise" :
>
> procedure TIB_ColumnInteger.SetAsString( const NewValue: string );
> var
> tmpVal: string;
> begin
> tmpVal := NewValue;
> if Assigned( FOnSetText ) then
> FOnSetText( Self, tmpVal );
> tmpVal := Trim( tmpVal );
> if ( Length( tmpVal ) = 0 ) then
> begin
> if IsNullable or (( Row.RowType = rtField ) and FBlankIsNull )
> then
> Clear
> else
> Value := 0;
> end
> else
> Value := StrToInt( tmpVal );
> end;
>
> Thanks in advance and sorry my english.
>
> Geraldo Lopes de Souza