Self/fi
Deutsch · English · Esperanto · Suomi
Self on avainsana, jota voidaan käyttää esimerkiksi metodeissa viitaten siihen objektiin, jolle parhaillaan suoritettu menetelmä on vedetty. Varattua sanaa self käytetään edustamaan sen luokan esiintymää, jossa se näkyy. Selfiä voi käyttää luokan jäseniin ja viittauksena nykyiseen instanssiin.
procedure TForm1.FormCreate(Sender: TObject);
begin
// Self osoittaa tässä esimerkissä TForm1-luokkaan
Self.Caption := 'Test program';
Self.Visible := True;
end;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.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
