TApplication

From Lazarus wiki
Revision as of 18:17, 19 November 2020 by Arent (talk | contribs)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

TApplication (with instance Application) that is available in every Lazarus program.

Unlike forms, and components on the forms a (single) instance of TApplication is created before any user line of code. In a .lpr file (a pascal file containing the keyword 'program' ) the Application-variable is used to create the applications form(s):

program pMyTest;
uses
  Forms, uMyForm

{$R *.res}

begin
  Application.Initialize();
  Application.CreateForm( TMyForm, MyForm );
  Application.Run();
end.

TMyForm is assumed a descendant of TForm and defined in uMyForm.pas

see also