把A 做成一个过程封装起来 procedure A; begin showmessage('A'); end;procedure TForm1.Button1Click(Sender: TObject); begin if true then if (application.MessageBox('选择代码', '请选择是否执行', [MB_YESNO]) = IDYES) then A else A; end;
来晚了小妹妹 你怎么专门问这些问题啊 要看书啊不过楼上那样写,我觉得容易引起歧义 procedure TForm1.Button1Click(Sender: TObject); begin if true then begin if (application.MessageBox('选择代码', '请选择是否执行', [MB_YESNO]) = IDYES) then A end else A; end;这样可读性强些吧,嘿嘿
procedure TForm1.Button1Click(Sender: TObject); label AA; begin if true then begin if messagebox(0,pchar('Yes or No ?'),pchar('提示'), MB_YESNO+MB_ICONQUESTION)= mryes then goto AA else exit; end else goto AA; AA: begin ShowMessage('(True and Yes) or False'); end; end;
if(//true)
if(flag==1)
A();
else return;
else
A();
if(//true)
if(flag==1)
A();
else return;
else
A();
procedure A;
begin
showmessage('A');
end;procedure TForm1.Button1Click(Sender: TObject);
begin
if true then
if (application.MessageBox('选择代码', '请选择是否执行', [MB_YESNO]) = IDYES) then
A
else
A;
end;
要看书啊不过楼上那样写,我觉得容易引起歧义
procedure TForm1.Button1Click(Sender: TObject);
begin
if true then
begin
if (application.MessageBox('选择代码', '请选择是否执行', [MB_YESNO]) = IDYES) then
A
end
else
A;
end;这样可读性强些吧,嘿嘿
label AA;
begin
if true then
begin
if messagebox(0,pchar('Yes or No ?'),pchar('提示'),
MB_YESNO+MB_ICONQUESTION)= mryes then
goto AA
else exit;
end else goto AA; AA: begin
ShowMessage('(True and Yes) or False');
end;
end;