jjschwartz
Technical User
I'm currently learning Delphi and Object Pascal after many years with other languages. I seem to have a basic misunderstanding.
The prototypical code that's in the first chapter of every book is:
unit Unit1;
type
TForm1 = class(TForm) { The type declaration of the form begins here }
end; { The type declaration of the form ends here }
var
Form1: TForm1;
implementation { Beginning of implementation part }
end. { End of implementation part and unit}
It seems I make a new class, TForm1, that is a descendant of TForm. Then I create Form1, an instance of the class TForm1.
Why do I have to create a new class TForm1? Why can't Form1 be an instance of TForm?
TIA
Jeff Schwartz
The prototypical code that's in the first chapter of every book is:
unit Unit1;
type
TForm1 = class(TForm) { The type declaration of the form begins here }
end; { The type declaration of the form ends here }
var
Form1: TForm1;
implementation { Beginning of implementation part }
end. { End of implementation part and unit}
It seems I make a new class, TForm1, that is a descendant of TForm. Then I create Form1, an instance of the class TForm1.
Why do I have to create a new class TForm1? Why can't Form1 be an instance of TForm?
TIA
Jeff Schwartz