
I have a simple question. I've been using classes, such as CGUI and Crypt. I'm interested in making my own. However, this one area confuses me.
If I have a class inside of a class, how can I access values from the initial class? Take the following example:class example{ __new(){ gui,1:+lastfound this.hwnd:=winexist() this.subclass:=new this.subclass() } class subclass{ __new(){ msgbox,% this.hwnd ;Say I had some GDI+ crap to put in here... I'd need the HWND from the first class. } } }
I know I could pass it as a parameter. For example,this.subclass:=new subclass(this.hwnd)
, but I'd rather not have duplicates. For example:class example{ __new(){ gui,1:+lastfound this.hwnd:=winexist() this.subclass:=new this.subclass(this.hwnd) } class subclass{ __new(h){ this.hwnd:=h msgbox,% this.hwnd } } }
Apologies if my requests sounds a bit... Nubbish..
Thanks in advance!