MAINDEFINE current_form STRING # keep track of current form CLOSE WINDOW SCREEN # replace with any of your forms that you can tell the difference between OPEN FORM aaa FROM "example005_aaa" OPEN FORM bbb FROM "example005_bbb" # Doesn't matter what the blank form is, as it never gets displayed # although if you make it the appropriate size and add a ui.Interface.Refresh() # in the next line then that is the size of the window OPEN WINDOW w WITH FORM "example005_blank" # First form DISPLAY FORM aaa LET current_form = "aaa" WHILE TRUE MENU "" ON ACTION aaa LET current_form = "aaa" DISPLAY FORM aaa EXIT MENU ON ACTION bbb LET current_form = "bbb" DISPLAY FORM bbb EXIT MENU ON ACTION common CALL common() # after calling common, have to reset form back to what it was CASE current_form WHEN "aaa" DISPLAY FORM aaa WHEN "bbb" DISPLAY FORM bbb END CASE ON ACTION common_window CALL common_window() ON ACTION close EXIT WHILE END MENU END WHILEEND MAIN FUNCTION common() # common routine displays its form OPEN FORM common FROM "example005_common" DISPLAY FORM common MENU ON ACTION continue EXIT MENU ON ACTION close EXIT MENU END MENU CLOSE FORM common # calling routine has to execute DISPLAY FORM to set the form # back to what it was END FUNCTION FUNCTION common_window() # common routine displays its form OPEN WINDOW common_window WITH FORM "example005_common" MENU ON ACTION continue EXIT MENU ON ACTION close EXIT MENU END MENU # and then sets its form back to what it was CLOSE WINDOW common_windowEND FUNCTION
MAIN DEFINE f1 INTEGER DEFINE f2 INTEGER OPEN FORM form_a FROM "a" DISPLAY FORM form_a INPUT BY NAME f1; OPEN FORM form_b FROM "b" -- the form_a is removed automatically DISPLAY FORM form_b INPUT BY NAME f2;END MAIN
MAIN DEFINE f1 INTEGER DEFINE f2 INTEGER OPEN FORM form_a FROM "a" DISPLAY FORM form_a INPUT BY NAME f1 ON KEY(f5) OPEN FORM form_b FROM "b" DISPLAY FORM form_b -- the form_a is still alive, but hidden INPUT BY NAME f2; -- new the parent INPUT gets active again -- no need to display form_a again -- the runtime will remove form_b and show form_a automatically END INPUTEND MAIN