nnnik wrote:You cannot get a pointer of data that's inside an array/object by using &.
You need to use .getAdress()
Thanks. With the caveat that I think .getAddress only gives address for string values
nnnik wrote:
Also in AutoHotkey using & probably does not do what you think it does.
I think it's supposed to give me the address of where the contents of a variable are stored. Is that right?
The expressions I used (preceded by "&") return a func object, so I'm expecting to get the address for the func object.
nnnik wrote:
Additionally the func function accepts the name of any function. MyClass.MyMethod is not the name of any function.
Makes sense... but still wondering why func function accepts "MyClassPrototype.MyMethod" as a function name?
Helgef wrote:Methods wrote: Methods are stored by reference in the class object.
Meaning, the metod is not stored in the class instance.
I understand this to mean that within the class object, there is a reference to another object (the method).
But since the base of the class instance is a reference to the class object, I understand that class.method and classInstance.base.method and classInstance.method are all referencing the same object (method)...? It seems to me I must be misunderstanding something here?
Helgef wrote:
Obviously, there is no function named MyClass.MyMethod or MyClass.base.MyMethod.
You've both made the same point, so again I seem to be missing something when I find the need to ask
SAbboushi wrote: ... why func function accepts "MyClassPrototype.MyMethod" as a function name?
Helgef wrote:To get the address of an object stored in another object, &obj.key is fine. MyClassPrototype.MyMethod returns a Func object, the same one as Func('MyClassPrototype.MyMethod'), so &MyClassPrototype.MyMethod == &Func('MyClassPrototype.MyMethod') is true, with both or without any &'s.
OK - this was my understanding before I posted... and so again...
SAbboushi wrote: ... why func function accepts "MyClassPrototype.MyMethod" as a function name?
Helgef wrote:Methods wrote:You should read
meta-functions, it describes what happens when you do
MyClass.MyMethod, and why it returns the same as
MyClassPrototype.MyMethod.
I've been looking at that page for weeks now... still having trouble making sense of the logic flow re: "when script gets, sets or calls a key which does not exist within the target object" without examples (which I'm building as my understanding grows thanks in large part to this forum).
For this post though, I believe the relevant outcome is "Search for a matching key [i.e. MyMethod] in the base object's own fields." which I understood before I posted. Is this what you meant? Wondering (specifically) what it was about my post that prompted you to suggest this link? I'm still not seeing what I seem to be missing...!
Helgef wrote:
Obviously, there is no function named MyClass.MyMethod or MyClass.base.MyMethod. The naming convention is not documented as far as I know, which is bad, it should be.
The naming convention of...?