Subject Re: [IBO] OnAfterModify event fire twice if using IB_Column.AsVariant
Author Helen Borrie
At 04:10 PM 13/02/2005 +0100, you wrote:

>OnAfterModify event fire twice if using IB_Column.AsVariant:
>- first when setting the field as not Null
>- second when setting the value of the field
>IB_Column.AsString work as expected - fire only once
>IB_Column.AsVariant := 'test';
>IB_Column.AsString := 'test';
>should behave the same.

Why? AsVariant has to test and perform two conversions. You get what you

>The logic of setting a variant value (and TIB_Column.Assign(TIB_Column))
>should be changed.

I'm curious as to why you need to use AsVariant at all. Why not just use
the Value property? It will trip any necessary type validation, as
required, and avoid exceptions on nulls...