在while/for/repeat循环中:1. 有没有什么机制能够在循环体中间推出循环的?类似C/C++的break和Basic的Exit For或Exit Do。
2. 有没有什么机制能够在循环体中退出本次循环,进入下一次循环的?类似C/C++的continue小弟原本玩C/C++,最近要用Delphi,有些东西不太习惯。
2. 有没有什么机制能够在循环体中退出本次循环,进入下一次循环的?类似C/C++的continue小弟原本玩C/C++,最近要用Delphi,有些东西不太习惯。
你的三角是乍混来的?
PASCAL:
loop
exit
你也是用C的???
你太土:
loop 继续循环
exit 退出一个循环
-----虽然已结贴,不过我怀疑你在倒分,保留投诉权利------
如果你不明白以下英文的意思,给我来信,我可以告诉你,免得你以后再丢人现眼:
//=================================
The Continue procedure causes the flow of control to proceed to the next iteration of the enclosing for, while, or repeat statement.The compiler reports an error if a call to Continue isn't enclosed by a for, while, or repeat statement.Note: Continue does not violate the flow of control dictated by a try..finally construct. If a call to Continue causes control to leave the try clause, the finally clause is entered.//=================================
The Break procedure causes the flow of control to exit a for, while, or repeat statement and continue at the next statement following the loop statement.A call to Break must be contained in a for, while, or repeat statement, or the compiler reports an error.Note: Break does not violate the flow of control dictated by a try..finally construct. If a break occurs inside the try clause, the finally clause is entered.//=================================
Loops allow you to execute a sequence of statements repeatedly, using a control condition or variable to determine when the execution stops. Object Pascal has three kinds of control loop: repeat statements, while statements, and for statements.
You can use the standard Break and Continue procedures to control the flow of a repeat, while, or for statement. Break terminates the statement in which it occurs, while Continue begins executing the next iteration of the sequence.
//=================================