The difference between exit,abort,break,continue in Delphi

Source: Internet
Author: User
Tags error code

Delphi said out of the break,continue, Exit,abort, Halt, Runerror.
1. Break forces the exit loop (which can only be placed in a loop) and is used to force exit from the for statement, while statement, or repeat statement.
2. Continue is used to force the loop to be closed from the for statement, while statement or repeat statement, and to start the next loop.
3. Exit is used to exit from the current code block. If the code is the main program, terminate the program, or the procedure or function immediately if it is a function or procedure.
4, Abort abort the operation of the program, resulting in no error exception information. Jump out of the ancestor module. And the difference between exit is
Procedure P1;
Begin
P2;
P3;
End

procedure P2;
Begin
Abort Exit
End

Procedure P3;
Begin
ShowMessage ().
End
If Abort is used, the P3 is not executed and can be executed to P3 if Exit is used.
5. Halt is used to forcibly terminate the execution of the application and return to the operating system (non-normal exit mode).
6. Runerror terminates the execution of the program and generates a run error (return error code).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.