Consultor Eletrônico



Kbase P25941: How to use the Progress.ini based application modes
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   5/27/2003
Status: Unverified

GOAL:

How to use the Progress.ini based application modes

FACT(s) (Environment):

Progress 9.1x

FIX:

During the process of developing an application there are (at least) three modes of operation - Development, Testing, and Production. It is handy to have the application know what mode it is being run in so it can act differently in some circumstances. For example, when running in development mode you want your application exit process to just return - thus staying within the Progress environment. In both testing and production you probably prefer to quit on exit. You may also choose to vary the error handling and message reporting.

One way to easily set up an application mode is to use a special section in the progress.ini file. Within this [Application] section you can define basic defaults and settings to be read on startup.

An example -

In the ini file

[SitePro]
LoginType=Auto
UserLogin=RDG
UserPasswd=RDG
DefaultSite=WIS
AppMode=Development

In the first program run

GET-KEY-VALUE SECTION "ShopPro" KEY "AppMode" VALUE g-app-mode.

This combination puts the value "Development" into the variable g-app-mode. In our application g-app-mode is a local variable that can be queried via a procedure call. It could just as easily be a global variable, an attribute in a smartobject, etc.

In addition to the application mode setup we also allow for two types of login - automatic or prompted. When set to automatic it doesn't use a login dialog but gets the user and password from the ini key elements. This is another example of making it easy to run one way for development and testing, while another when running in production.