Role Playing Database (API Documentation) 3.1.3

Functions
ReadConfiguration Namespace Reference
TclCommon

## Functions
| ReadConfiguration (filename, configurationArrayName)
| IsEven (i)
| WriteConfiguration (filename, configurationArrayName)
| ConfigurationType (...)

## Detailed Description

The Read Configuration File code is contained in this namespace.

## Function Documentation

## ◆ ConfigurationType()

ReadConfiguration::ConfigurationType | ( |  | ... | ) |

This macro defines the body of a snit::type that implements a program's global configuration (or preferences). The argument list is a set of configuration variable defination lists. Each list contains four elements: the label, the key list name (a one or two element list), the type (one of directory, infile, outfile, string, enumerated, integer, double, or color), and the default value. Enumerated types have an additional (fifth) element, the set of possible values. Numerical types (double and integer) have a range of values as a fifth element. This macro should only be called inside a snit::type defination.

The configuration (aka preferences) are stored in the user's home directory. The file name under UNIX (including MacOSX) starts with a dot and contains the application rootname (from argv0). Under MS-Windows, the file name does not start with a dot. Instead .rc is appended.

Parameters

  ... | The configuration variable definitions.

  Type methods defined:
  - load Load the configuration.
  - save Save the configuration.
  - edit Edit the configuration with a popup dialog.
  - getkeyoption Get a keyed option. Takes two arguments.
  - getoption Get a non-keyed option. Takes one argument.
  - getanonoymous Gets the anonoymous option. Takes no arguments.

## ◆ IsEven()

ReadConfiguration::IsEven | ( | i |  | ) |

Check if a number is even.

Parameters

  i | The number to check.

Returns
  a boolean.

## ◆ ReadConfiguration()

ReadConfiguration::ReadConfiguration | ( | filename | ,
|  | configurationArrayName |
| ) |  |

This procedure reads in the configuration file named by the filename into the array named by configurationArrayName.

Parameters

  filename | The name of the configuration file.
  configurationArrayName | The name of the array to hold the configuration.

## ◆ WriteConfiguration()

ReadConfiguration::WriteConfiguration | ( | filename | ,
|  | configurationArrayName |
| ) |  |

This procedure writes the configuration contianed in configurationArrayName to the file named by the filename.

Parameters

  filename | The name of the configuration file.
  configurationArrayName | The name of the array holding the configuration.