Chr converts an ordered data to an ANSI character.

Source: Internet
Author: User

Try // try to execute
{SomeCode}
Handle t // execute when an error occurs. Handle T has a specific error type.
{SomeCode}
End;

Try // try to execute
{SomeCode}
Finally // execute it in any way
{SomeCode}
End;

Example:
Try
Age: = StrToInt (Edit1.Text );
ShowMessage (Format ('Born in % d', [YearOf (Now)-Age]);
Except
On EConvertError do
Showmessage ('the input and edit box is not a valid number! ');
On ERangeError do
Showmessage ('The age value in the input and edit box is too large! ');
End;

Reserved Words on... Do is used to determine the exception type. Note that the statement after limit T must be included in a certain on... Do module, but cannot exist independently. This is another difference from finally.

Exception Handling
Try
// If a success or failure occurs, the finally statement is jumped into and executed.
Finally

End;
Try
// Skip into failed t to execute
Except t on e: Exception do
ShowMessage (e. Message );
End;

Http://hi.baidu.com/delphidiary/blog/item/7afa9680368156d2bc3e1eb9.html

 

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.