Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图将旧项目从 Delphi 5 迁移到 Delphi XE。当我现在尝试编译项目时,出现此错误:
[DCC Error] *.pas(352): E2003 Undeclared identifier: 'VarToStr'
关于这一行:
PropValue := VarToStr(GetPropValue(Component, PropInfo^.Name));
它在 Delphi 5 中运行良好,据我所知,XE 也支持 VarToStr?
将变体(可能还有 TypInfo ...)添加到使用子句。
我认为您不需要调用 VarToStr,您可以像这样分配给字符串:
PropValue := GetPropValue(Component, PropInfo^.Name);