do form main for i=1 to 5 && to put 5 object on the form, named Room1 to Room5 main.addobject("Room"+alltrim(str(i)), "MyRoom") endfor define class MyRoom as container add object "Detector" as MyShape procedure Detector.click wait window "You clicked me!" endproc enddefine define class MyShape as shape procedure init with this .borderstyle=0 .backstyle=0 endwith endproc enddefineBut I want to pass parameter to the MyShape object such that I can do different motion when user click on different MyRoom object.
define class MyRoom as container procedure Init this.addobject("Detector", "MyShape") endproc procedure Detector.click wait window "You clicked me!" endproc enddefine define class MyShape as shape procedure init with this .borderstyle=0 .backstyle=0 endwith endproc enddefineI also tried this code but it says "unknown member THIS"
define class MyRoom as container add object "Detector" as MyShape enddefine define class MyShape as shape procedure init with this .borderstyle=0 .backstyle=0 endwith endproc procedure this.click wait window "You clicked me!" endproc enddefineSo only the first set of code works, the other two not. What's wrong with them? No matter how, I only want to pass paramter to the class definitin such that I can determine which shape is clicked, any help please?