| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 48)

Using an Initialization File

When you launch a new G2 process, you can cause it to automatically execute a series of commands. You do this by creating an initialization file that the new G2 process executes. The initialization file must have the name g2.init.

Each time you launch a new G2 process, it automatically looks for a file named g2.init. If the process finds such a file, it executes the commands in the file sequentially in the order in which they appear.

To use an initialization file, do one of the following:

If you do not provide an initialization file, the G2 process continues executing without initialization.

Coding an Initialization File

A g2.init file is an ASCII file that contains one of more commands. Each command must begin on a new line. Blank lines can appear between the command lines. The commands have the same function as the corresponding menu choices in G2.

The following table lists the initialization commands and their purposes:

Initialization Command Purpose
connect to foreign image "filename"
Connect to the specified foreign image.
load KB "filename"
[,{starting afterwards |
not starting afterwards |
warmbooting afterwards |
automatically resolving
conflicts |
bringing formats
up-to-date} ]

Load the specified knowledge base.
merge KB "filename"
Merge the specified knowledge base into the current KB.

load attribute file "filename"

Load attribute values for a set of items from the specified attribute file.

start G2
Start the current KB.

In the initialization commands the " (double quotes) characters are required.

If you include a start G2 command, it should be the final command in the g2.init file. The G2 process does not execute any commands that it reads after executing a start G2 command.

If G2 detects an error in any initialization command, it stops executing the rest of the initialization file, and therefore might load only part of the knowledge that your G2 process requires. To avoid this situation, you should thoroughly test the command sequences found in your initialization file.

| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (6 out of 48)

Copyright © 1997 Gensym Corporation, Inc.