I'm starting with Delphi and I just find annoying that I get default varuables of Form1. I want to give it other name like FormMain or something like that. So let's see my code:
unit main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TForm9 = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
{$R *.dfm}
end.
Code above works fine when I compile. Now I change next code to:
unit main;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs;
type
TFormMain = class(TForm)
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TFormMain;
implementation
{$R *.dfm}
end.
And in other file .dpr I also change it to:
program mainProject;
uses
Vcl.Forms,
main in 'main.pas' {FormMain};
{$R *.res}
begin
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TFormMain, FormMain);
Application.Run;
end.
And this gives me errors, what ever I change. I just want to change default form name.