Difference between revisions of "TApplication"

From Lazarus wiki
(Created page with "'''TApplication''' (with instance Application) that is available in every Lazarus program. Unlike forms, and components on the forms a (single) instance of TApplication is cr...")
 
Line 1: Line 1:
 
'''TApplication''' (with instance Application) that is available in every Lazarus program.
 
'''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 applictions form(s):
+
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 [[Reserved words|keyword]] 'program' ) the Application-variable is used to create the applictions form(s):
  
 
<syntaxhighlight lang="pascal">
 
<syntaxhighlight lang="pascal">

Revision as of 16:24, 19 November 2020

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 applictions form(s):

program pMyTest;
uses
  Forms, uMyForm

{$R *.res}

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