Passing Parameters to a subscreen

Rick Hill rmhill@core.com
Tue, 16 Mar 2004 14:25:32 -0800


Hi Shaun,

Sure - you can definitely let the subscreen know where it was called
from by passing a temp item like T_WHERE_FROM, and base any logic you
want in the subscreen on that value.  

for example,...

code in one menu:

LET T_WHERE_FROM = "MENU_A"
RUN SCREEN the_subscreen PASSING T_WHERE_FROM

code in the other menu:

LET T_WHERE_FROM = "MENU_B"
RUN SCREEN the_subscreen PASSING T_WHERE_FROM

code in the sub-screen:

SCREEN the_subscreen RECEIVING T_WHERE_FROM

TEMPORARY T_WHERE_FROM CHAR*10  NORESET

FILE SOMEFILE DETAIL NOITEMS OCCURS 2
   SELECT IF TYPE = "1" AND T_WHERE_FROM = "MENU_A" &
        OR TYPE="2" AND "T_WHERE_FROM = "MENU_B"
.
.
.
;  or you could have code like this...
;
PROCEDURE PREUPDATE
BEGIN
  IF T_WHERE_FROM = "MENU_A"
  THEN ERROR "Sorry - updates not allowed if you came here from menu A."
END