S
shodoy
Unregistered / Unconfirmed
GUEST, unregistred user!
我的DLL代码为:
library Testing
uses
SysUtils,
Classes;
{$R *.res}
Function EnCode(SCode:String):String;
Var
ECode:String;
i:Integer;
begin
ECode:='';
For i:=1 To Length(SCode) Do
ECode:=ECode+Chr(byte(SCode)+1);
Result:=ECode;
end;
exports EnCode;
begin
end.
调用:
Function EnCode(SCode:String):String:Far;
External 'Testing';
procedure TForm1.Button1Click(Sender: TObject);
Var
SCode:String;
begin
SCode:='AAA';
Form1.Caption:=EnCode(SCode);
end;
当SCode的长度小于等于3时有时不出错,有时出错,但是当SCode长度大于3时一定有出错提示,但是结果还是正确的.
请问错出在哪里?
library Testing
uses
SysUtils,
Classes;
{$R *.res}
Function EnCode(SCode:String):String;
Var
ECode:String;
i:Integer;
begin
ECode:='';
For i:=1 To Length(SCode) Do
ECode:=ECode+Chr(byte(SCode)+1);
Result:=ECode;
end;
exports EnCode;
begin
end.
调用:
Function EnCode(SCode:String):String:Far;
External 'Testing';
procedure TForm1.Button1Click(Sender: TObject);
Var
SCode:String;
begin
SCode:='AAA';
Form1.Caption:=EnCode(SCode);
end;
当SCode的长度小于等于3时有时不出错,有时出错,但是当SCode长度大于3时一定有出错提示,但是结果还是正确的.
请问错出在哪里?