case本身判断语句,我想条件是按整句来判断的,可以自动跳出 Case i of 0:; 1: else ..... end; 相当于: if (i=0) or (i=1) or ...then else end;
break,continue都没用成功过,我用goto,楼上的各位大侠用成功的给个例子好不好。var i ,j : integer; label aaa; begin i := 1; j := 2; case i of 1 :begin if j = 2 then goto aaa; showmessage('aa'); end; end; aaa: showmessage('bb'); end;
case I of 1..5: Caption := 'Low'; 6..9: if i=6 then begin Caption := 'High' else caption:='Other' end; 0, 10..99: Caption := 'Out of range'; else Caption := ''; end;加 if 判断嘛
退出语句比较:Abort 停止运行某事件,即Abort后的程序不运行。 Break 强制退出循环。 Continue 强制缩短循环。 Exit 强制退出程序块。 Halt 强制终止程序执行。
Case i of
0:;
1:
else
.....
end;
相当于:
if (i=0) or (i=1) or ...then
else
end;
i ,j : integer;
label aaa;
begin
i := 1;
j := 2;
case i of
1 :begin
if j = 2 then
goto aaa;
showmessage('aa');
end;
end;
aaa: showmessage('bb');
end;
但是exit好象不可以,exit好象是退出整个事件过程的
不管怎样,谢谢大家的关心,我不会亏待大家的!^_^
6..9: if i=6 then
begin
Caption := 'High'
else
caption:='Other'
end;
0, 10..99: Caption := 'Out of range';
else
Caption := '';
end;加 if 判断嘛
Break 强制退出循环。
Continue 强制缩短循环。
Exit 强制退出程序块。
Halt 强制终止程序执行。