This worked but it's getting way complicated. So I think __Change can simplify it.
Code:
Obj := { "": { base: { property : "value" } }
, base: { _NewEnum : func("MyEnum")
, myfunc : func("myfunc")
, __Set : func("MySet")
, __Get : func("MyGet") }}
Obj.a := 1
Obj.a := 2
Obj.b := 3
msgbox % Obj.Property
Obj.myfunc()
For k, v in Obj
msgbox %k% : %v%
MyEnum(this){
Return this[""]._NewEnum()
}
MySet(this, key, value){
msgbox % "Function: `t" A_ThisFunc "`nEdited key: `t" key "`nPassed value:`t" value
return this["",key]:=value
}
MyGet(this, key){
return this["",key]
}
myfunc(this, params*) {
msgbox % "Function: " A_ThisFunc
}
fragman wrote:
I'm not quite sure why it's not getting the property from the base object though.
It's because it reads
Obj[""].base instead of
Obj.base.
Quote:
Btw: Why not use class syntax?
I don't have much of a meaning for it. I would go with a simpler way.
HotkeyIt, It also works. Thanks.