Roise
Roise

Reputation: 364

'VarToStr' in Delphi XE?

Im trying to migrate an old project from Delphi 5 to Delphi XE. When i try to compile the project now i get this error:

[DCC Error] *.pas(352): E2003 Undeclared identifier: 'VarToStr'

about this line:

PropValue := VarToStr(GetPropValue(Component, PropInfo^.Name));

It works fine in Delphi 5, and as far as i have found out VarToStr is also supported in XE ??

Upvotes: 1

Views: 4534

Answers (2)

David Heffernan
David Heffernan

Reputation: 613592

I don't think you need to call VarToStr, you can just assign to the string as so:

PropValue := GetPropValue(Component, PropInfo^.Name);

Upvotes: 5

user497849
user497849

Reputation:

Add Variants(and maybe TypInfo aswell...) to uses clause.

Upvotes: 17

Related Questions