RUNMODAL Function (Page)
Creates, launches, and closes a page that you specify. When a page is run modally, no input (keyboard or mouse click) can occur except to objects on the modal page.
[Action :=] Page.RUNMODAL
Parameters
- Page
-
Type: Variable
After you define this variable, you can run the following page functions:
-
SETTABLEVIEW
-
SETRECORD
-
GETRECORD
-
RUN
-
RUNMODAL
Unlike the PAGE.RUN Function, the variable is not automatically cleared after this function executes.
If the page you specify does not exist, a compilation error occurs.
-
Type: Code
This optional return value specifies what action the user took. The following table shows the possible return values.
| Return value | Description |
|---|---|
|
OK |
The user selected OK to exit the window |
|
Cancel |
The user selected Cancel to exit the window |
|
LookupOK |
The user selected OK on a lookup window |
|
LookupCancel |
The user selected Cancel on a lookup window |
|
Yes |
The user selected Yes |
|
No |
The user selected No |
|
Close |
The user selected Close, ESC, or closed the window using the title bar |
|
FormHelp |
The user selected Help |
|
RunObject |
The user selected an option that ran another object |
|
RunSystem |
The user selected an option that ran an external program |
If you know at design time the exact page that you want to run, use this function or the RUN Function (Page).
If you do not know at design time the exact page that you want to run, use the PAGE.RUN Function or the PAGE.RUNMODAL Function.
After you define the page variable, you can use it before and after you run the page. If you use the PAGE.RUN Function, you can only use the variable before you run the page.
This example shows how to use this function. Assume that the variable SomePage has been defined as Page 1.
CLEAR(SomePage) SomePage.XXX; // any user-defined function SomePage.SETTABLEVIEW(MyRecord); SomePage.SETRECORD(MyRecord); IF SomePage.RUNMODAL = Action::LookupOK THEN SomePage.GETRECORD(MyRecord)...
Note that this code example includes the CLEAR Function to ensure the variable has been cleared.