function SameText(const S1, S2: shortString): Boolean;
var
L: Integer;
begin
L := Length(S1);
Result := (L = Length(S2)) and (StrLIComp(@S1[1], @S2[1], L) = 0);
end;
编译通不过,提示:ambiguous overloaded call to StrLIComp,如何修改?
...全文
3443打赏收藏
提示:ambiguous overloaded call to StrLIComp,如何修改?
function SameText(const S1, S2: shortString): Boolean; var L: Integer; begin L := Length(S1); Result := (L = Length(S2)) and (StrLIComp(@S1[1], @S2[1], L) = 0); end; 编译通不过,提示:ambiguous overloaded call to StrLIComp,如何修改?
function SameText(const S1, S2: shortString): Boolean;
var
L: Integer;
begin
L := Length(S1);
Result := (L = Length(S2)) and (StrLIComp(PAnsiChar(@S1[1]), PAnsiChar(@S2[1]), L) = 0);
end;