Sign in Join
Wiki copytemporary

As/de

Deutsch · English · Español · Français · Suomi

Zurück zu den reservierten Wörtern.\

Das reservierte Wort as gehört zur objektorientierten Programmierung.
Das reservierte Wort as 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.

Revision 2, last changed by WikiArchive .

Talk about this page

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