As/fr: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: As/fr
| Old | New | Line | |
|---|---|---|---|
| 1 | + | ## As | |
| 2 | + | ||
| 3 | + | Le [[Keyword/fr|mot clé]] **as** est utilisé pour convertir (utiliser une variable d'un type comme si elle était d'un autre type). | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | procedure TmainForm.selectionGridDrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); | |
| 7 | + | begin | |
| 8 | + | (Sender As TDBGrid).DefaultDrawColumnCell(Rect,DataCol,Column,State); | |
| 9 | + | end; | |
| 10 | + | ``` | |
| 11 | + | ||
| 12 | + | ici la variable Sender de type TObject est convertie en TDBGrid. | |
| 13 | + | ||
| 14 | + | L'opérateur As est une extension de Pascal Objet et Delphi. | |
| 15 | + | ||
| 16 | + | --- | |
| 17 | + | *From the Free Pascal wiki, page "As/fr", 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).* | |
| 18 | + | Category: Pascal/fr |
