function Encode(Str:String):String;
var//加密?
TmpChr:AnsiChar;
i,Len:integer;
begin
Result:=Str;
Len:=Length(Result);
TmpChr:=Result[1];
for i:=1 to Len-1 do
Result[i]:=Result[i+1];
Result[Len]:=TmpChr;
end;
-----------------
报错如下:
[dcc32 Error] Unit1.pas(36): E2010 Incompatible types: 'AnsiChar' and 'PAnsiChar'
[dcc32 Error] Unit1.pas(43): E2010 Incompatible types: 'Char' and 'AnsiChar'
[dcc32 Error] Unit1.pas(55): E2010 Incompatible types: 'AnsiChar' and 'Char'
function Encode(Str: AnsiString): AnsiString;
var // 加密?
TmpChr: AnsiChar;
i, Len: integer;
begin
Result := Str;
Len := Length(Result);
TmpChr := Result[1];
for i := 1 to Len - 1 do
Result[i] := Result[i + 1];
Result[Len] := TmpChr;
end;