User Tools

Site Tools


jvs:cigal:manual:chapter2:module

CIGAL Reference Manual, Chapter 2 (Commands): MODULE

MODULE -- Specify a text file to be included and expanded by the preprocessor

usage: MODULE ModFileName Arg1 Arg2 …

The MODULE command is used to allow a single line of text to be replaced by a separate text file. Optional rguments specified on the MODULE line will be substituted into appropriate argument fields in the module text file as it is copied. Substitution of MODULE lines is done by a pre-processor, before the command line is passed to the parser routine that breaks the line into separate arguments and checks for syntax. This means that the original command line need not be a syntactically valid CIGAL command by itself, provided that it is syntactically correct after the MODULE has been substituted by the pre-processor.

MODFILENAME is the name of the text file to be substituted for the MODULE line. If there are additional arguments (ARG1, ARG2, etc.) on the MODULE line those values will be inserted into the text file as it is read. Up to 20 optional arguments can be specified on the MODULE line. Argument locations in the text file (MODFILENAME) are identified by $$x, where 'x' is the argument number (1-20).

For example, if you describe a sequence of events for each trial in a file called “trial.txt” containing:

wait          0     0     -1    $$1
erase         0     0     -1
fix           1     0     -1    $$2      -1   -1
$$3          $$4    1     -1    $$5      -1   -1
erase         0     0     -1
fix           1     0     -1    $$6

Then, a stimulus PPF file that looks like:

showplay 0
sbackcolor = "white"
preprocflg = 15
return

instruct.jpg  0     0      0    5000      -1   -1
MODULE trial.txt  1000   3000   pic1.jpg   112   300   4000
MODULE trial.txt   500   2000   pic2.jpg   120   300   5000
MODULE trial.txt  1000   3000   pic3.jpg   132   400   2000
...

Would be converted to “ppflist.tmp”:

instruct.jpg  0     0      0    5000      -1   -1
wait          0     0     -1    1000
erase         0     0     -1
fix           1     0     -1    3000      -1   -1
pic1.jpg    112     1     -1    300       -1   -1
erase         0     0     -1
fix           1     0     -1    4000
wait          0     0     -1    500
erase         0     0     -1
fix           1     0     -1    2000      -1   -1
pic2.jpg    120     1     -1    300       -1   -1
erase         0     0     -1
fix           1     0     -1    5000
wait          0     0     -1    
erase         0     0     -1
fix           1     0     -1    2000      -1   -1
pic3.jpg    132     1     -1    400       -1   -1
erase         0     0     -1
fix           1     0     -1    2000
...

See Also:
DEFINE(2), DECLARE(2), PREPROCESSOR(1), SYNTAX(1)

CIGAL Home, CIGAL Manual, Commands List, Manual Help

jvs/cigal/manual/chapter2/module.txt · Last modified: 2023/02/23 18:43 (external edit)