Self/fi: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Self/fi
| Old | New | Line | |
|---|---|---|---|
| 1 | + | `Self` on [[Keyword/fi|avainsana]], jota voidaan käyttää esimerkiksi [[Method/fi|metodeissa]] viitaten siihen objektiin, jolle parhaillaan suoritettu menetelmä on vedetty. [[Reserved word/fi|Varattua sanaa]] `self` käytetään edustamaan sen [[Class/fi|luokan]] esiintymää, jossa se näkyy. `Self`iä voi käyttää luokan jäseniin ja viittauksena nykyiseen instanssiin. | |
| 2 | + | ||
| 3 | + | ``` pascal | |
| 4 | + | procedure TForm1.FormCreate(Sender: TObject); | |
| 5 | + | begin | |
| 6 | + | // Self osoittaa tässä esimerkissä TForm1-luokkaan | |
| 7 | + | Self.Caption := 'Test program'; | |
| 8 | + | Self.Visible := True; | |
| 9 | + | end; | |
| 10 | + | ``` | |
| 11 | + | ||
| 12 | + | --- | |
| 13 | + | *From the Free Pascal wiki, page "Self/fi", as it stood on 2022-08-06 after a change by Kai Burghardt, 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).* |
