def button a.
def frame b a.
run a.p persistent (input a:handle).
wait-for 'choose' of a.
/* a.p */
def input parameter ip-handle as handle no-undo.
on 'choose' of ip-handle
message 'test' view-as alert-box.
How to do the same thing with classes (The OOABL way)?
Below code doesn't work:
DEF BUTTON a.
DEF FRAME b a.
DEF VAR c AS CLASS click.
DO WITH FRAME b:
c = NEW click(a:HANDLE).
WAIT-FOR 'choose' OF a.
/* click.cls */
CONSTRUCTOR click(INPUT ip-handle AS HANDLE):
ON 'choose':U OF ip-handle
VIEW-AS ALERT-BOX INFO BUTTONS OK.
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).
/* Define button here and set the attribute write method to run trigger (not
in constructor ) */
Class fFrame :
/* Define variable For button class.
Create object of button in constructor of frame. */
I think no need to run persistently. I think it will help You.