Another noob question: Basically I'm looking into equivalent of 'this' Java keyword - way to get current instance of class.
Another noob question: Basically I'm looking into equivalent of 'this' Java keyword - way to get current instance of class.
In pascal you use self for accesing object instance to which current code belongs.
Also if you need to interact with same object several times in a row you can use:
So calling this:Code:with SomeObject do begin .... end;
is same as calling this:Code:with Form1 do begin Width := 640; Height := 480; Color := clWhite; end;
Code:Form1.Width := 640; Form1.Height := 480; Form1.Color := clWhite;
'this' inside a class method is 'self'
Bookmarks