|
INIT_FILE
This statement specifies the name of a text initialization file to be loaded and executed before each run of GPP2.
INIT_FILE <string> ;
The file name may include a full path name, or have no path at all. If no path is specified, GPP2 will look for the file in the same folder as the post-processors files.
Multiple INIT_FILE statements may be specified in one post-processor. The files are read and executed in the same order of the INIT_FILE statements.
Example
INIT_FILE "C:\Cimatron\standard.txt" ;
INIT_FILE "pp.txt" ;
INIT_FILE "*.txt" ; // '*' is replaced with the PP name
If the file specified in the string argument cannot be found - a warning message is printed, but execution continues.
The "*.txt" string in the last example has a special meaning. If the first character of the string is '*', GPP2 replaces it with the post-processor name (without any extension). If the PP file is called demo.ex2, then this statement will load the file "demo.txt".
This is a way for the PP developer to give users the ability to create multiple post-processors that only differ by their initialization, without having to recompile the EX2 file.
The INIT files may contain the following:
-
Assignment statements, in the standard EX2 format for these statements. The assigned variable may be any valid GPP2 variable (system, user-defined or interaction). The assigned values may be simple constants or full expressions.
-
Comments (same format as in EX2 files) and empty lines.
Examples to statements inside INIT files:
SEQ_START = 1000; // numeric assignment
MyComment = "this is a comment"; // string assignment
SEQ_START = SEQ_START + SEQ_INC; // expression
Note that all the user variables used in the INIT files must be defined in the EX2 file (with FORMAT or INTERACTION statements).
Errors encountered in the execution of INIT file statements are reported, and the faulty statements are ignored. However, execution continues and other (valid) statements will take effect.
This is a declarative statement. It must appear in the declaration part only, before any execution block. Trying to use it in a regular block (For example, at STARTUP) will result in a compilation error.
|