Progress
Programming
Handbook
Managing Multiple Environments
If you are writing an application builder, you might want to maintain separate environments for each application.
Typical Scenario
You can follow these steps to separate application environments:
- Have the user select an existing application or create a new one.
- Load the existing application environment, or create and load a new one using the LOAD statement.
- Execute the USE statement to make the selected application environment current.
- If the application exists, run it according to user input.
If the application is new:
- Allocate the number of available color and font table entries for the new application by setting the NUM–ENTRIES attribute of the COLOR–TABLE and FONT–TABLE handles.
- Set internal colors and fonts from user input using the SYSTEM–DIALOG COLOR and FONT statements, or set internal colors using the COLOR–TABLE handle.
- Create application widgets and code from user input using the current color and font definitions.
- Test and revise application resources and widgets according to user input.
- Repeat Steps 1 through 5 for as many applications as you need to work on simultaneously.
- When the user terminates all work on an application and wants to save it:
- Save the color and font table entries to the current environment using the PUT–KEY–VALUE statement with the COLOR and FONT options.
- Save the application code to procedure files.
- Delete all widgets for the application from Progress memory using the DELETE WIDGET statement.
- Remove the current application environment from Progress memory using the UNLOAD statement.
- Execute the USE statement according to user input to set a new current environment, then repeat Steps 4 through 8 until all work is done.
Helpful Hints for Environment Management
Many variations in the typical scenario are possible, but this is a summary of important tasks to consider in any application that uses multiple environments:
- Before defining colors and fonts for immediate use at run time, set or adjust the size of the current color and font tables as required using the NUM–ENTRIES attribute of the COLOR–TABLE and FONT–TABLE handles.
- Use the PUT–KEY–VALUE statement with the COLOR and FONT options to save newly created and newly modified color and font definitions from the current color and font tables to the current environment.
- Always set a current environment with the USE statement before or after executing the UNLOAD statement for the current environment, even if the current environment you set is the default environment. Otherwise, Progress returns an error when you attempt to display or enable a widget.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |