CIGAL Reference Manual, Chapter 1 (Topics): startup
When CIGAL begins to run, it goes through a series of steps to initialize its hardware and software settings. The first step is an internal initialization hard-coded inside CIGAL itself and involves detecting how it was launched and what kind of computer you are using. All other steps are controlled by running a series of CIGAL script programs (.IMP files), which are simple text files. The start-up process is divided into different program modules to provide flexible customization. The following is an overview of this start-up sequence:
If you use the behavioral paradigm software (e.g. Showplay), CIGAL will run through a paradigm initialization sequence (pdigminit) the first time you access any paradigm menus or commands. This involves running the following command files:
The following sections describe various aspects of the startup sequence in more detail.
The first thing CIGAL does is to create and initialize a number of special internal variables (see Data variables). The most important of these are:
Once it has finished its internal startup routines, CIGAL then looks in its SYSDIR directory for a file called:
If the SYSSTART.IMP file is found, CIGAL sets the SYSSTART flag in its internal STATE variable and then runs the SYSSTART.IMP file as a CIGAL program. SYSSTART.IMP contains standard global variable declarations and character string definitions that need to always be available. A standard SYSSTART.IMP file is provided with the CIGAL software distribution. SYSSTART allocates memory and runs the configuration setting scripts (see below) to initialize hardware and software settings.
When it finishes, SYSSTART checks to see if there is another file named
in the same SYSDIR directory, and if found that file is then run as a CIGAL program. If you want to add your own system-wide CIGAL startup commands that will be run for every user, the “local_sysstart.imp” file is the place to put them. That startup program can also call other CIGAL macro programs if you want. The CIGAL distribution does not contain a “local_sysstart.imp” file, so any commands you put in that file will not be affected by future CIGAL software upgrades.
In addition to initializing software variables, the standard SYSSTART.IMP program attempts to run a hardware configuration script by looking for one of the following files:
The above files are looked for in the order listed and the search stops as soon as it finds one. That file is run as a standard CIGAL macro program. Even if all 3 files exist, CIGAL will only run the first one it finds.
The CIGAL distribution does not contain “sysconfig.imp” or “userconfig.imp” files, so any commands you put into those files will not be affected by future CIGAL software upgrades. The “generic_sysconfig.imp” file is part of the standard distribution so do not change that file because your changes will be lost f you upgrade CIGAL versions.
The standard SYSSTART.IMP program also checks to see if it was started with a file name as a command line argument. In Windows that can happen by dropping a text file onto the CIGAL.exe file (or its shortcut), by selecting CIGAL.exe to open a text file, or by using a Windows “Command Prompt” window and explicitly entering a CIGAL command line with a file argument. In any of those situations, the CMDLIN string variable in CIGAL will indicate the name of the file you want it to open. If a file name is specified in CMDLIN, the SYSSTART program will assume that file is a CIGAL macro program and will automatically attempt to run that program as soon as it finishes the rest of its start up procedures.
This option is rarely used but may prove convenient for some applications.
After the SYSSTART.IMP startup macro has completed, CIGAL next looks in your current working directory (CURDIR for a file called:
If found, it sets the START flag in its internal STATE variable and then runs the START.IMP file as a CIGAL program. If START.IMP is not found in the local directory, this step is simply skipped; no other directories will be searched.
The START.IMP file is the place to put user or task specific initialization routines such as loading useful menus, assigning default data file names (see DATADIR(4)), or setting up a particular graphics configuration.
Once the START.IMP macro has completed, CIGAL changes its STATE variable to INTERACTIVE and then enters its normal interactive mode and waits for you to enter commands either by typing on the keyboard or, if menus are active, by selecting a menu command by moving the cursor.