def button a.
def frame b a.
run a.p persistent (input a:handle).
enable all.
wait-for 'choose' of a.
/* a.p */
def input parameter ip-handle as handle no-undo.
on 'choose' of ip-handle
do:
message 'test' view-as alert-box.
end.
How to do the same thing with classes (The OOABL way)?
Below code doesn't work:
CLASS test-b:
DEF BUTTON a.
DEF FRAME b a.
DEF VAR c AS CLASS click.
CONSTRUCTOR test-b():
DO WITH FRAME b:
ENABLE ALL.
c = NEW click(a:HANDLE).
WAIT-FOR 'choose' OF a.
END.
END CONSTRUCTOR.
END CLASS.
/* click.cls */
CLASS click:
CONSTRUCTOR click(INPUT ip-handle AS HANDLE):
ON 'choose':U OF ip-handle
DO:
MESSAGE 'test'
VIEW-AS ALERT-BOX INFO BUTTONS OK.
END.
END CONSTRUCTOR.
END CLASS.
Thanks,
Parul.
Hi,
I think u should make a seprate CLASS for Button and and related events.
And, seprate Class for Frame , that will contain a instance on Button Class.
This method of coding in OOPs is called Deligation.
According to ecapsulation, write every thing of Class i.e. Method and attribute
of that entity in a single class.
For your Code :
Make two class (it is not exact code , it is just dummy code).
Class bButton:
/* Define button here and set the attribute write method to run trigger (not
in constructor ) */
End class.
Second Class:
Class fFrame :
/* Define variable For button class.
Create object of button in constructor of frame. */
End Class.
I think no need to run persistently. I think it will help You.