[dcc32 Error] psystr.pas(249): E2251 Ambiguous overloaded call to 'Pos'
System.pas(28005): Related method: function Pos(const string; const string; Integer): Integer;
System.pas(28165): Related method: function Pos(const WideString; const WideString; Integer): Integer;
我在以下功能上收到上述错误。我怎样才能解决这个问题?代码是由另一个编码器给我的,但我是一个完全的业余爱好者,所以简单的答案将不胜感激!
function ExplodeStr(const AString: WideString; AWordIndex: Integer; AChar: Char): WideString;
var
Index, Counter: Integer;
begin
Result := Trim(AString);
Counter := 0;
Index := Pos(AChar + AChar, Result);
while Index > 0 do
begin
Delete(Result, Index, 1);
Index := Pos(AChar + AChar, Result);
end;
Index := Pos(AChar, Result);
while ((Counter < AWordIndex) and (Index > 0)) do
begin
Delete(Result, 1, Index);
Index := Pos(AChar, Result);
Counter := Counter + 1;
end;
if (Counter < AWordIndex) then
Result := '';
Index := Pos(AChar, Result);
if Index > 0 then
Delete(Result, Index, MaxInt);
end;