X
xhqing
Unregistered / Unconfirmed
GUEST, unregistred user!
谁会给我看一下并尝试运行这段代码为什么不能执行?我想给字符串加密,十分感谢!
function jm(beforeStr:string):string;
var key:string;
i:integer;
begin
key:='password ASCII jm';
beforeStr:=copy(beforeStr,1,20);
key:=copy(key,1,20);
result:='';
for i:=1 to 20 do
begin
result:=chr(swap(ord(beforeStr) xor ord(key)));
end;
end;
程序能编绎通过,可是执行到result:=chr(swap(ord(beforeStr) xor ord(key)));
时停下来了,并且是在最后的循环时出现错误的,为什么呢?
function jm(beforeStr:string):string;
var key:string;
i:integer;
begin
key:='password ASCII jm';
beforeStr:=copy(beforeStr,1,20);
key:=copy(key,1,20);
result:='';
for i:=1 to 20 do
begin
result:=chr(swap(ord(beforeStr) xor ord(key)));
end;
end;
程序能编绎通过,可是执行到result:=chr(swap(ord(beforeStr) xor ord(key)));
时停下来了,并且是在最后的循环时出现错误的,为什么呢?