What is the use of Initialization and Finalization sections of Delphi?

Questions by RyanJames   answers by RyanJames

Showing Answers 1 - 6 of 6 Answers

gopalar

  • Oct 24th, 2008
 

Every delphi unit(pas file) you can have Initialization and Finalization section which will be executed during unit load and unlond respectively

Unit2.pas

unit Unit2;

interface

uses
implementation

Initialization
//Do your Initialization Steps Here
Finalization
//Do your Finalization Steps Here
end.

  Was this answer useful?  Yes

The initialization section is optional. It begins with the reserved word initialization and continues until the beginning of the finalization section or, if there is no finalization section, until the end of the unit. The initialization section contains statements that are executed, in the order in which they appear, on program start-up. So, for example, if you have defined data structures that need to be initialized, you can do this in the initialization section.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions