Sign in Join
Wiki copytemporary

Revision 1 of 2, by GAN on 1-31-2020. The page as it is now.

As/de


Zurück zu den reservierten Wörtern.

Das reservierte Wort <b>as</b> gehört zur objektorientierten Programmierung.
Das reservierte Wort <b>as</b> wird für die Typumwandlung (Typecast) eines Objektes in eine Klasse verwendet.
Dafür muss das Objekt eine Instanz der Klasse sein.
Beispiel:\

pascal
var
  objForm  : TForm;

begin
  ...
  // Typumwandlung auf dem Standardweg
  objForm := TForm1(Sender: TObject);

  // Typumwandlung von 'Sender' unter Verwendung des Schlüsselwortes As
  objForm := Sender As TForm1;
  ...



--Olaf 18:04, 30 October 2012 (UTC)


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.