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

Graeme Geldenhuys graeme at mastermaths.co.za
Fri Dec 9 14:17:29 CET 2005


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?

----------------------------------------------
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.







More information about the fpc-devel mailing list