Subject | Re: [ib-support] variant types |
---|---|
Author | Nando Dessena |
Post date | 2002-03-05T21:46:53Z |
Daniel,
should make sure that the variant conversion is possible. EDAxPos should
hold a whole number and cannot be null for your statement to succeed.
take care of nulls (with the first way you transfer nulls as well as
numbers, with the second you convert nulls to 0s).
If EDAxPos is not an integer, then the statement simply does not make
sense. if you don0t know whether it will be a number or not, and want to
copy it only if it is, try StrToIntDef(EDAxPos.AsString, <some default
number>).
HTH
--
____
_/\/ando
> DataM.AxlesAXPOS.AsInteger := EDAxPos.Value;not that this has anything to do with Firebird or InterBase, but you
>
> I get an error "Invalid Variant type conversion".
should make sure that the variant conversion is possible. EDAxPos should
hold a whole number and cannot be null for your statement to succeed.
> Does anyone have a suggestion on how I should handle this?Either use Value on both sides of the := or use AsInteger. That would
take care of nulls (with the first way you transfer nulls as well as
numbers, with the second you convert nulls to 0s).
If EDAxPos is not an integer, then the statement simply does not make
sense. if you don0t know whether it will be a number or not, and want to
copy it only if it is, try StrToIntDef(EDAxPos.AsString, <some default
number>).
HTH
--
____
_/\/ando