Main Menu

KB#00134-Using environmental variables in the CONFIG.BBX file

Title:

Using environmental variables in the CONFIG.BBX file

Description:

In some cases it is necessary to have entries in the configuration file that refer to a specific terminal or workstation. These cases may be handled by using the if..else..endif options in the configuration file. 

The if command accepts one argument for testing. The argument appears in the form: 

string1{=string2} 

If string1 appears without string2, this is considered to be a test against the current FID(0). If string2 is present, string1 is searched for in the environment, with the result compared against string2. 

If the strings compared are equal, all of the lines appearing between the if and the next else or endif are executed. If the strings compared are not equal, all lines in the configuration file will be ignored until either an else or endif is encountered. If an else is encountered, the lines encountered until the next endif are executed. 

Only one level of if testing is supported. 

As an example, consider the case of a configuration where a terminal has a local printer, such as: 

if T6 
alias P0 /dev/tty2a "local" CR,SLON=1B41,SLOFF=1B42 
endif 

This defines a printer P0 (or replaces an existing definition) on the terminal that becomes T6. 

The following example demonstrates setting a prefix if an environment variable is set: 

if USERDESC=Tempoary Account 
prefix c:/basis/ 
endif 

This example is especially helpful, as it demonstrates that you can compare environment variables whose values include mixed case and spaces. 

Note: All text following the IF is considered part of the conditional expression, including any trailing spaces or tabs which might not be visible with all text editors. Extra spaces at the end of a line could cause unpredictable behavior. 



Last Modified: 03/24/1998 Product: PRO/5 Operating System: All platforms

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel