Progress
Report Builder
Deployment Guide


Accessing Initialization (.INI) Files

To access initialization file information from the Progress 4GL, you can use the _getini.p procedure. Because the status file created by Report Engine has the same format as an initialization file, you can use the _getini.p procedure to read the information out of the status file. Use the following command in the Progress 4GL application:

RUN aderb/_getini.p (section-name, entry-name, entry-default, 
       OUTPUT entry-value, ini-pathname, OUTPUT success) 

The following list describes the arguments for the _getini.p procedure:

section-name

The name of the section in the initialization file. In the Report Engine status file, this is also the name of the report being run.

entry-name

The name of the entry that you want. For example, RO-ERROR-CODE or RO-ERROR-MESSAGE in the report status file.

entry-default

The default value to be used if the entry is not found in the specified section.

entry-value

The character variable that will display the value of the specified entry.

ini-pathname

The full pathname to the initialization file being used. For example, with the Report Engine table interface, this is the file specified by the Report Status File (-rbstatfile) parameter.

success

The logical variable that gets assigned a TRUE value (yes) if Progress returns a string of zero of more characters and a FALSE value if no string is returned. Currently, this parameter always gets assigned a TRUE value (yes). The parameter is included to allow for future enhancements.

The progini.p procedure is an example of how to run the _getini.p procedure:

progini.p
/* 1 */ 
  DEF VAR result AS CHARACTER FORMAT "X(70)".
  DEF VAR success AS LOGICAL.

/* 2 */ 
  RUN aderb/_getini.p ("Customer Report", "RO-ERROR-CODE", "", 
  OUTPUT result,"c:\examples\rbrun.out", OUTPUT success).

/* 3 */ 
  IF success THEN DO:
    DISPLAY result.
    PAUSE. 
  END
/* 4 */ 
  ELSE MESSAGE "It failed" VIEW-AS ALERT-BOX ERROR. 

The commented numbers correspond to the following step-by-step descriptions:

  1. Define the variables that will pass the character value and logical value for the _getini.p procedure.
  2. Call aderb/_getini.p and specify all six arguments, including the variables to pass the result and return values.
  3. Test the value in the success variable, then display the appropriate information.
  4. Currently, the ELSE code will never be executed. The test shown will never fail—success always has the value true. This is an artifact of how the underlying MS-Windows function behaves.

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095