Differences between exit, abort, break and continue in delphi

Source: Internet
Author: User

In delphi, break, continue, exit, abort, halt, and runerror are displayed.
1. The break force exit loop (which can only be placed in the loop) is used to force exit from the For statement, while statement, or repeat statement.
2. continue is used to forcibly end the called loop from the For statement, while statement, or repeat statement and 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. If it is a function or process, the process or function is immediately executed.
4. abort terminates the program and generates no error information. Jump out of the ancestor module. The difference between exit and exit is: Copy codeThe Code is 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 application execution and return to the Operating System (abnormal exit mode ).
6. runerror: Terminate the program execution and generate a running error (the error code is returned ).

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.