As/es: what changed
Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.
| Old | New | Line | |
|---|---|---|---|
| 1 | 1 | ## As | |
| 2 | 2 | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - | ||
| 3 | + | 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. | |
| 6 | 4 | ||
| 7 | - | ||
| 5 | + | Ejemplo: | |
| 6 | + | ``` | |
| 8 | 7 | procedure TmainForm.selectionGridDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); | |
| 9 | - | ||
| 10 | - | ||
| 11 | - | ||
| 8 | + | begin | |
| 9 | + | (Sender As TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State); | |
| 10 | + | end; | |
| 12 | 11 | ``` | |
| 13 | 12 | ||
| 14 | 13 | Aquí la variable Sender del tipo (type of) TObject se convierte/asigna como (**as**) tipo (type) TDBGrid. | |
| 15 | 14 | ||
| 16 | 15 | --- | |
| 17 | - | ||
| 16 | + | *From the Free Pascal wiki, page "As/es", as the Internet Archive kept it on 2023-03-20. 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).* |
