[fpc-devel] VarAsType: Could not convert variant...

Florian Klaempfl florian at freepascal.org
Sat Dec 10 17:55:33 CET 2005


Graeme Geldenhuys wrote:

> Hi,
> 
> Still busy porting my Delphi app to FPC.  The VarAsType call generated
> the error listed below.  This line worked under Delphi.
> FPC ver 2.0.1 on Win2000.
> 
> Is this a bug?

Not anymore ;)

> 
> ----------------------------------------------
> var
>   lVar : Variant ;
> begin
>   lVar := VarAsType('',varEmpty);
> 
> ----------------------------------------------
> 
> <Error>
>   <Message>TTestTIUtils.tiIsVariantOfType: Could not convert variant of
> type (String) into type (Empty)</Message>
>   <ExceptionClass>EVariantTypeCastError</ExceptionClass>
>   <ExceptionMessage>Could not convert variant of type (String) into type
> (Empty)</ExceptionMessage>
>   <SourceUnitName>../inc/variants.pp</SourceUnitName>
>   <LineNumber>2804</LineNumber>
>   <FailedMethodName>VARCASTERROR</FailedMethodName>
> </Error>
> ----------------------------------------------
> 
> 
> G.
> 
> 
> 
> 
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
> 




More information about the fpc-devel mailing list