Self/de: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Self/de
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Zurück zu den [[Reserved words/de|reservierten Wörtern]]. | |
| 2 | + | ||
| 3 | + | Das reservierte Wort <b>Self</b> gehört zur objektorientierten Programmierung. | |
| 4 | + | ||
| 5 | + | Das reservierte Wort Self ist ein Zeiger innerhalb einer Klassemethode auf die Klasse selbst. | |
| 6 | + | ||
| 7 | + | Self steht für die Klasse zu der die Methode gehört. | |
| 8 | + | ||
| 9 | + | Self kann nur innerhalb von Methoden verwendet werden. | |
| 10 | + | ||
| 11 | + | Beispiel: | |
| 12 | + | ||
| 13 | + | ``` pascal | |
| 14 | + | procedure TForm1.FormCreate(Sender: TObject); | |
| 15 | + | begin | |
| 16 | + | // Self steht in diesem Beispiel für die Klasse TForm1 | |
| 17 | + | Self.Caption := 'Testprogramm'; | |
| 18 | + | Self.Visible := True; | |
| 19 | + | end; | |
| 20 | + | ``` | |
| 21 | + | ||
| 22 | + | --- | |
| 23 | + | *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](/wiki-contact).* |
