HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"This" in vjass.

08-20-2009, 03:29 AM#1
T3RMINUS
Well, I was reading the jasshelper manual, because I was wondering what "this" meant, and i found this:
Quote:
this : A keyword that denotes a pointer to current instance, [normal] methods are instance methods which means that they are called from an already assigned variable/value of that type, and this will point to it. In the above example we use this inside the method to assign x and y, when calling p.move() it ends up modiffying x and y attributes for the struct pointed by p.
Could someone clarify please?
08-20-2009, 03:33 AM#2
Vexorian
Something like this
08-20-2009, 03:38 AM#3
T3RMINUS
I think i get it now. Methods are associated with a specific object?
08-20-2009, 03:38 AM#4
Pyrogasm
Yes.
08-20-2009, 03:39 AM#5
T3RMINUS
I see. Thank you. Is there any way to find out what by looking at the code?

Edit: I understand now. It's related to the struct.