How to use __get, __set and __call meta functions in Classes?
Posted: 22 Apr 2019, 12:43
Hello Friends..
I am trying to learn classes in AutoHotKey. I have learnt a lot of things in classes by these tutorials-
https://www.autohotkey.com/boards/viewtopic.php?f=7&t=6177
https://www.autohotkey.com/boards/viewtopic.php?f=7&t=41332
https://autohotkey.com/boards/viewtopic.php?f=7&t=54588
https://www.youtube.com/watch?v=yTCeM-txIp0&t=2619s
https://www.autohotkey.com/boards/viewtopic.php?t=6033
Still, I am confusing for the use of meta functions in classes which are following-
__get()
__set()
__call()
__delete()
__new()
However, I've known the use of __new() meta meta function in classes. As far as i know about __new() meta function is that- when we instantiate the class then it first of all calls __new meta function and runs the codes whichever written in __new function. For example-
But, I am unable to understand the uses of rest meta functions like __get(), __set(), __call(), __delete().
Please help me guide..
Thanks a lot..
I am trying to learn classes in AutoHotKey. I have learnt a lot of things in classes by these tutorials-
https://www.autohotkey.com/boards/viewtopic.php?f=7&t=6177
https://www.autohotkey.com/boards/viewtopic.php?f=7&t=41332
https://autohotkey.com/boards/viewtopic.php?f=7&t=54588
https://www.youtube.com/watch?v=yTCeM-txIp0&t=2619s
https://www.autohotkey.com/boards/viewtopic.php?t=6033
Still, I am confusing for the use of meta functions in classes which are following-
__get()
__set()
__call()
__delete()
__new()
However, I've known the use of __new() meta meta function in classes. As far as i know about __new() meta function is that- when we instantiate the class then it first of all calls __new meta function and runs the codes whichever written in __new function. For example-
Code: Select all
obj:=new myclass("Auto Hot Key")
return
class myclass
{
__new(var1)
{
MsgBox You have instantiated myclass and %var1% has been passed as __new's parameter
}
}
Please help me guide..
Thanks a lot..