永发信息网

delphi程序错误 [Error] Unit1.pas(38): Declaration expected but 'IF' found

答案:2  悬赏:10  手机版
解决时间 2021-02-15 14:30
  • 提问者网友:人傍凄凉立暮秋
  • 2021-02-14 22:46
procedure TForm1.btn1Click(Sender: TObject);
Var
MyStr,InsStr:string;
IndexNo,Count:Integer;
if StrToInt(edt3.Text) > Length(edt1.Text) then
begin
ShowMessage('请不要超过长度!');
Exit;
end;
indexNo :=StrToint(edt2.Text);
Count :=StrToint(edt3.Text);
Mystr :=edt1.Text;
InsStr :=edt4.Text;
Insert(InsStr,Mystr,indexNO);
Edt1.text :=MyStr;
end.
最佳答案
  • 五星知识达人网友:平生事
  • 2021-02-14 23:27
少了个Begin
procedure TForm1.btn1Click(Sender: TObject);
Var
MyStr,InsStr:string;
IndexNo,Count:Integer;
begin
if StrToInt(edt3.Text) > Length(edt1.Text) then
begin
ShowMessage('请不要超过长度!');
Exit;
end;
indexNo :=StrToint(edt2.Text);
Count :=StrToint(edt3.Text);
Mystr :=edt1.Text;
InsStr :=edt4.Text;
Insert(InsStr,Mystr,indexNO);
Edt1.text :=MyStr;
end.
全部回答
  • 1楼网友:举杯邀酒敬孤独
  • 2021-02-15 00:20
begin th:=loadlibrary('zlds200_tcp_dll.dll'); {装载dll} if th>0 then begin try tp:=getprocaddress(th,pchar('zlds200connect')); if tp<>nil then begin tf:=tintfunc(tp); inttostr(tf(620)); {调用zlds200connect函数} end else showmessage('zlds200connect函数没有找到'); finally freelibrary(th); {释放dll} end; end else showmessage('zlds200_tcp_dll.dll没有找到'); end;
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯