Procedure as trigger for several widgets

Posted by OctavioOlguin on 03-Apr-2018 19:15

Greetings.

Im trying to imagine (so I will program it) a normal procedure I can call from three or four fill-ins on window.

Tha idea is as follows.   I have those widgets that call this procedure  on the leave event to validate it's value.  The call sholud send a ..widget-handle?... of the fill-in so the called procedure would validate:  It's value diferent from others, that the value is a valid formated value, that it exists on a table (the value is PK to a table), and this has to be repeated three of for times on a data-entry window..

What would be the format of such procedure?   

TIA

Jorge

All Replies

Posted by Mike Fechner on 04-Apr-2018 00:15

Something like this:

ON 'leave':U OF FRAME {&frame-name} ANYWHERE
    PERSISTENT RUN leaveHandler IN THIS-PROCEDURE .

And then in the procedure, based on the SELF handle, no need to send a widget-handle.

PROCEDURE leaveHandler :

    MESSAGE "self" SELF:NAME SELF:TYPE 
        VIEW-AS ALERT-BOX INFO BUTTONS OK.

END PROCEDURE.

Posted by Patrick Tingen on 04-Apr-2018 01:56

Personally I would prefer passing the handle of the widget to the handling procedure. That makes it explicitly clear what it is doing and makes it possible to call the procedure from other situations, where the 'SELF' would not work.

This thread is closed