Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-12

VarAsType: Could not convert variant...

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

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.

Reply by email

Florian Klaempfl
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
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 ;)

Show quoted text 31 lines
---------------------------------------------- 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 - http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply by email