delphi程序错误 [Error] Unit1.pas(38): Declaration expected but 'IF' found
procedureTForm1.btn1Click(Sender:TObject);VarMyStr,InsStr:string;IndexNo,Count:Intege...
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. 展开
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. 展开
展开全部
少了个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.
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.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询