Self
Deutsch · English · Esperanto · Suomi
Self is a keyword which can be used in instance methods to refer to the object on which the currently executing method has been invoked. Reserved word self used to represent an instance of the class in which it appears. Self can be used to access class members and as a reference to the current instance.
procedure TForm1.FormCreate(Sender: TObject);
begin
// Self stands for the TForm1 class in this example
Self.Caption := 'Test program';
Self.Visible := True;
end;From the Free Pascal wiki, page "Self", as it stood on 2020-09-04 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
