Loads a menu script into memory and makes its menus available for installationint sm_mnscript_load(int mem_location, char *script);
- Specifies where to load this script into memory. You can load a script only once into a given memory location. The script's memory location determines the scope at which its menus can be installed and whether you can install identical instances of the same menu.
- Loads the menu script into application memory. Menus in application memory can be installed at any scope—application, screen, and field. All instances of a menu installed from application memory are always identical; changes in one are immediately propagated to the others.
- Loads the menu script into the current screen's memory. Each screen maintains its own memory location. You can install menus for a screen and its widgets from that screen's memory.
- Loads the menu script into the current field's memory. Each field maintains its own memory location. You can install a popup menu for a field from its own memory location.
- The name of the menu script to load into memory.
sm_mnscript_loadloads the specified script into application, screen, or field memory. All menus that are defined in that script are subsequently available for installation and display through sm_menu_install.
sm_mnscript_loadlets you load a menu into any memory location that is the same or higher than its caller, as shown in Table 5-18:
Table 5-18 Valid menu script load locations
Valid memory locations
For example, the application's startup routines in
jmain.ccan only load menu scripts into application memory, while a screen's entry procedure can load scripts into application memory and into its own memory.
A menu script's memory location determines the scope at which its menus can be installed:
- Application memory menus can be installed at all scopes: application, screen, and field. Instances of a menu installed from application memory all share the same content; changes to one are propagated to all.
- Screen memory menus can be installed at screen and field scopes. All copies of a screen menu installed from screen memory are unique; copies of a field menu installed from screen memory all share the same content within that screen.