Substitute

From BR Wiki
Jump to navigation Jump to search

The Substitute config specification substitutes all references to one file name string with another file name string in commands and OPEN statements.

You can now redirect the Ctrl-P (print screen) output to a file/printer of your choice by substituting 'PRN:/10' with the SUBSTITUTE specification. The following example sends Ctrl-P output to LPT2:

SUBSTITUTE PRN:/10,LPT2:

Comments and Examples

The following one-line addition to BRConfig.sys allows you to use a serial printer instead of a parallel printer as the default printer on DOS or NetWork systems:

SUBSTITUTE PRN:/10,COM1:

On a Unix / Linux system, the following SUBSTITUTE specification changes the execution of programs written for the first serial port on a DOS system so that tty22 will be used instead:

SUBSTITUTE COM1:,:/dev/tty22

While Business Rules! is in execution, a single SUBSTITUTE specification may be specified or removed without affecting the remainder of the substitute table. The following example removes the substitution specified above from the substitute list (the BRConfig.sys file is not changed by this command, it is simply overridden):

CONFIG SUBSTITUTE COM1:,:/dev/tty22 CLEAR

All substitutions (except [WSID] substitutions) may be removed with the following command:

CONFIG SUBSTITUTE CLEAR

Syntax

Diagram Default

Add the specified substitution to the substitution table.

Start-up Default

Use no file name substitutions.

Parameters

"String1" is either a full or partial file name reference that is to be replaced with a substitution.

"String2" is either a full or partial file name reference that is to be used in place of all program references to string1.

The "CLEAR" parameter is functional only when SUBSTITUTE is specified with the CONFIG command.

When specified immediately after the SUBSTITUTE keyword, CLEAR removes all substitutions (including those previously specified with CONFIG) from the substitution list. When specified after the "string1" and "string2" parameters, CLEAR removes only the specified substitution from the list

Technical Considerations

  1. The CONFIG command can be used during program execution to specify or remove SUBSTITUTE specifications.
  2. Business Rules converts all SUBSTITUTE parameters to uppercase except those that begin with a colon.
  3. All Unix / Linux file name references must begin with a colon.
  4. See the Multi-User Programming chapter for more information about using SUBSTITUTE to change printers.
  5. The STATUS SUBSTITUTE command provides a listing of all currently active substitutions specified by CONFIG SUBSTITUTE or the BRConfig.sys file.
Substitute

Substitute now supports both upper and lower case results.

00200 execute 'config SUBSTITUTE "XXX YYY" "AbCd EFg"'