Sign in Join
Wiki copytemporary

Self/de

Deutsch · English · Esperanto · Suomi

Zurück zu den reservierten Wörtern.

Das reservierte Wort Self gehört zur objektorientierten Programmierung.

Das reservierte Wort Self ist ein Zeiger innerhalb einer Klassemethode auf die Klasse selbst.

Self steht für die Klasse zu der die Methode gehört.

Self kann nur innerhalb von Methoden verwendet werden.

Beispiel:

pascal
procedure TForm1.FormCreate(Sender: TObject);
begin
  // Self steht in diesem Beispiel für die Klasse TForm1
  Self.Caption := 'Testprogramm';
  Self.Visible := True;
end;

From the Free Pascal wiki, page "Self/de", as it stood on 2020-02-26 after a change by Trev, 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.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.