In Delphi, break, continue, exit, abort, halt, runerror are represented.
1. break forcefully exits the loop (can only be placed in the loop), used to forcefully exit from the For statement, while statement or repeat statement.
2. Continue is used to forcibly end this weighing loop from the For statement, while statement or repeat statement, and start the next cycle.
3. exit is used to exit from the current code block. If the code is a main program, the program will be terminated. If it is a function or procedure, the procedure or function will be executed immediately.
4. abort aborts the running of the program and generates exception information without reporting an error. Jump out of the ancestor module. The difference from exit is
Copy the code code as follows:
procedure p1;
begin
p2;
p3;
end;
procedure p2;
begin
abort; //exit;
end;
procedure p3;
begin
//showmessage()..
end;
If Abort is used, P3 cannot be executed. If Exit is used, P3 can be executed.
5. Halt is used to forcibly terminate the execution of the application and return to the operating system (abnormal exit method).
6. runerror terminates the execution of the program and generates a running error (returns an error code).