The TOOLS.INI File

PWB, like other Microsoft tools, stores information in a file called TOOLS.INI. This file retains information about how you want PWB to work under various circumstances. PWB expects to find this file in the directory specified by your INIT environment variable.

TOOLS.INI is a text file. You can edit it using PWB or any other text editor. PWB also can store information directly to TOOLS.INI when, for example, you choose the Save Colors button in the Colors dialog box. PWB modifies this file when you save a recorded macro, a changed switch, a new key assignment, a custom browser database, or a custom project template.

TOOLS.INI Section Tags

The TOOLS.INI file is divided into sections, separated by “tags.” These tags are specified in the form:

[tagname]

The tagname is the base name of an executable file, such as NMAKE, CVW, or PWB. The tag defines the start of a TOOLS.INI section that contains settings for the indicated tool.

PWB extends this simple syntax to enable you to take different action depending on the operating system or the current file's extension. The extended syntax is:

[PWB-modifier]

The modifier can be the base name of a PWB extension, an operating system's identifier, or a filename extension for files that you edit.

Operating-System Tags

The following table lists the operating-system tags for various operating environments. If you are running Windows, use the tag for the version of DOS that you are running.

Tag Operating Environment

[PWB-4.0] MS-DOS versions 4.0 and 4.01
[PWB-5.0] MS-DOS version 5.0

Be sure to use the correct version number for your operating system.

Filename-Extension Tags

The operating-system tags are read only once at startup. PWB reads the filename-extension tagged sections each time you switch to a file with that extension. For example, suppose that you want the tab stops for C and C++ files to be every four columns, and every eight columns for text files.

·To set tab options based on filename extension:

1.Open your TOOLS.INI file in an editing window.

2.Create a C and C++ section by typing the tag:

[PWB-.C PWB-.H PWB-.CPP PWB-.HPP]

3.Create a text file section by typing the tag:

[PWB-.TXT]

4.Put the appropriate Tabstops, Entab, and Realtabs switches in each section. The lines that begin with a semicolon are comments.

[PWB-.C PWB-.H PWB-.CPP PWB-.HPP]

; Set the tab stops for C and C++ to 4

tabstops : 4

; Translate white space to tabs

entab : 1

realtabs : no

[PWB-.TXT]

; Set the tab stops for text files to 8

tabstops : 8

; Translate white space to spaces

entab : 0

realtabs : no

Depending on whether the current file is a C (.C or .H) file or a text (.TXT) file, the tab stops are set at 4 or 8 columns, respectively.

PWB reads multiple sections and applies the appropriate settings. You can use this to your advantage by storing all your general settings in the [PWB] section and storing differences in separate tagged sections.

Filename-extension tagged sections are useful for the kinds of files you edit most frequently. However, it's impossible to define settings for every conceivable extension. To handle this case, PWB provides a special extension (..) that means “all extensions not defined elsewhere in TOOLS.INI.”

For example, to set tab stops to 8 for all files except C and C++ files, modify the preceding example to use the [PWB-..] tag in place of [PWB- .TXT].

Note :

When you choose the Save button in the Key Assignments, Editor Settings, and Colors dialog boxes, and when you save a recorded macro or custom Run menu command, PWB saves the setting in the main section. If the setting is for a PWB extension, it is saved in that extension's tagged section. PWB never modifies or writes settings in a filename-extension or operating-system section.

Named Tags

You can define tagged sections of TOOLS.INI that you load manually. Use manually loaded sections to make special key assignments, to load complex or rarely used macros, or to use a special PWB configuration under a particular circumstance.

The syntax for a manually-loaded section tag is:

[PWB-name]

Where name is the name of the tagged section. A single section of TOOLS.INI can be given several tag names. These tags have the form:

[PWB-name1 PWB-name2...]

When you want to use the settings defined in one of these named sections, pass the name of the section to the Initialize function (SHIFT+F8).

·To read a tagged section of TOOLS.INI:

Execute Arg name Initialize (ALT+A name SHIFT+F8)

You can use this method to read any tagged section, including the automatically loaded sections.

Note :

When you execute Initialize with no arguments, PWB clears all the current settings before reading the [PWB] section, including settings that you have made for specific PWB extensions. PWB does not reread the operating-system or other additional sections of TOOLS.INI. To reread the main section without clearing other settings that you want to remain in effect, label the main PWB section with the tag [PWB PWB- main]. You can then use Arg main Initialize to recover your startup settings, instead of using Initialize with no arguments.