Delphi XE E2251 Ambiguous overloaded call to ‘StrPas‘错误处理

delphi7中的语句:

 if  pos('Form111',strpas(@szText))<>0 then

在delphi xe中编译出错:

[DCC Error] Unit1.pas(84): E2251 Ambiguous overloaded call to 'StrPas'
  SysUtils.pas(8723): Related method: function StrPas(const PAnsiChar): AnsiString;
  SysUtils.pas(8728): Related method: function StrPas(const PWideChar): string;

在XE里可以这样用:

 if  pos('Form111', PChar(@szText))<>0 then

猜你喜欢

转载自blog.csdn.net/xyzhan/article/details/126619728