Copia del wikiespejo

Este es un espejo del wiki de pascal.chat. La edición, el historial y el inicio de sesión están allí.

As/es

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

As

La palabra reservada As pertenece a la programación orientada a objetos y se utiliza para convertir (TypeCast) un objeto en una clase. Para ello, el objeto debe ser una instancia de la clase.

Ejemplo:

pascal
procedure TmainForm.selectionGridDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
     (Sender As TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;

Aquí la variable Sender del tipo (type of) TObject se convierte/asigna como (as) tipo (type) TDBGrid.


From the Free Pascal wiki, page "As/es", 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.

Revisión 3, último cambio por WikiArchive .