Kbase P8555: How to pass values from a smart window to smart frame in sma
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/25/2003 |
|
Status: Unverified
GOAL:
How to pass a variable's value from a smart window to smart frame and viceversa
GOAL:
The frame is located inside a smart folder
FIX:
Create a procedure with OUTPUT parameters. One procedure in the smart window, and one in the smart frame.
i.e.:
Procedure sendval in the smart window:
DEFINE OUTPUT PARAMETER varout AS CHARACTER NO-UNDO.
varout = "this is being retrieved from the smart window".
Procedure gettestval in the smart frame:
DEFINE OUTPUT PARAMETER plval AS LOGICAL NO-UNDO.
plval = YES.
You can retrieve the above values by using the following code in buttons' triggers for example:
In the Smart Frame:
DEFINE VARIABLE hcontainer AS HANDLE NO-UNDO.
DEFINE VARIABLE varx AS CHARACTER NO-UNDO.
/* this returns the handle of the window */
hcontainer = DYNAMIC-FUNCTION('getContainerSource':U).
RUN sendval IN hcontainer
( OUTPUT varx /* LOGICAL */).
MESSAGE "value of varx is: " varx VIEW-AS ALERT-BOX.
In the Smart Window:
DEFINE VARIABLE tg AS LOGICAL NO-UNDO.
/* h_ftest is the handle to the frame */
RUN gettestval IN h_ftest
( OUTPUT tg /* LOGICAL */).
MESSAGE "value of logical variable is: " tg VIEW-AS ALERT-BOX.