As/de: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | - | ||
| 2 | 1 | Zurück zu den [[Reserved words/de|reservierten Wörtern]].\ | |
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 2 | + | ||
| 3 | + | Das reservierte Wort as gehört zur objektorientierten Programmierung.\ | |
| 4 | + | Das reservierte Wort as wird für die Typumwandlung (Typecast) eines Objektes in eine Klasse verwendet.\ | |
| 6 | 5 | Dafür muss das Objekt eine Instanz der Klasse sein.\ | |
| 7 | 6 | Beispiel:\ | |
| 8 | 7 | ||
| 9 | 8 | ``` pascal | |
| 10 | 9 | var | |
| 11 | 10 | objForm : TForm; | |
| 12 | 11 | ||
| 13 | 12 | begin | |
| 14 | 13 | ... | |
| 15 | 14 | // Typumwandlung auf dem Standardweg | |
| 16 | 15 | objForm := TForm1(Sender: TObject); | |
| 17 | 16 | ||
| 18 | 17 | // Typumwandlung von 'Sender' unter Verwendung des Schlüsselwortes As | |
| 19 | 18 | objForm := Sender As TForm1; | |
| 20 | 19 | ... | |
| 21 | 20 | ``` | |
| 22 | 21 | ||
| 23 | - | ||
| 24 | - | ||
| 25 | 22 | --Olaf 18:04, 30 October 2012 (UTC) | |
| 26 | 23 | ||
| 27 | 24 | --- | |
| 28 | 25 | *From the Free Pascal wiki, page "As/de", as it stood on 2020-01-31 after a change by GAN, 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).* | |
| 29 | 26 | Category: Reserved words/de |
