Programming Guide |
Registers a list of screens on the save list
int sm_svscreen(char **screen_list, int count);
screen_list
- Specifies the screens to add to the save list.
count
- The number of screens to add to
screen_list
.
C only
- 0 Success.
sm_svscreen
adds screens to the Panther-managed list of screens that are saved in memory. You can call this function to add screens to this list anywhere in your code; however, these screens and the data entered in them are saved in memory only when you close the screens for the first time. Consequently, access to the saved screens is more efficient only on subsequent opens of those screens.If a screen is already on the save list, Panther leaves that list entry unchanged. You can remove screens from the list with sm_unsvscreen. To check whether a screen is on the save list, use sm_issv.
This function saves processing time at the expense of memory. It is especially useful with read-only screens that use large amounts of external data, for example, from databases or other files. For instance, use this function to save in memory a help screen that gets its data from a database and is repeatedly opened.
/* sm_issv */
/* sm_svscreen */
/* sm_unsvscreen */
char *screens[] =
{
"start.scr",
"demo.scr",
"help.scr"
};int num_screens = sizeof(screens) / sizeof(char *);
void
save_screens()
{
/* Put 'screens' onto the save list. */
sm_svscreen(screens, num_screens);
}
void
release_screens()
{
/* Remove 'screens' from the save list. */
sm_unsvscreen(screens, num_screens);
}
void
release_screen(name)
char *name;
{
char *temp[1];
if (sm_issv(name))
{
temp[0] = name;
sm_unsvscreen(temp, 1);
}
}