X
xhcxhc100
Unregistered / Unconfirmed
GUEST, unregistred user!
function TForm1.setvalue(front, head, s: string): string;
var
i,j:integer;
a,b,c:string;
begin
a:=front;
b:=head;
c:=s;
i:=pos(a,c)+length(a);
j:=posex(b,c,i)+length(b);
result:=copy(c,i,j-i);
end;
function TForm1.editvalues(front, head ,s,str: string): string;
var
a,b,c,d,tmp:string;
i:integer;
begin
a:=front;
b:=head;
c:=s;
d:=str;
tmp:=setvalue(a,b,c);
showmessage(tmp);
i:=pos(copy(b,1,length(b)-1),tmp);
insert(str,tmp,i+length(b)-1);
showmessage(tmp);
result:=stringreplace(s,setvalue(a,b,c),tmp,[rfReplaceAll]);
end;
自定义函数最后result值不变 哪里出现错误了??
var
i,j:integer;
a,b,c:string;
begin
a:=front;
b:=head;
c:=s;
i:=pos(a,c)+length(a);
j:=posex(b,c,i)+length(b);
result:=copy(c,i,j-i);
end;
function TForm1.editvalues(front, head ,s,str: string): string;
var
a,b,c,d,tmp:string;
i:integer;
begin
a:=front;
b:=head;
c:=s;
d:=str;
tmp:=setvalue(a,b,c);
showmessage(tmp);
i:=pos(copy(b,1,length(b)-1),tmp);
insert(str,tmp,i+length(b)-1);
showmessage(tmp);
result:=stringreplace(s,setvalue(a,b,c),tmp,[rfReplaceAll]);
end;
自定义函数最后result值不变 哪里出现错误了??