|
LOAD_FILE
LOAD_FILE is formally a function, not a statement. However, it is described here (and not in the functions section) since it is actually used as a statement.
LOAD_FILE allows the GPP developer to load an external file and dump it, as is, to the current output G-Code file.
RESULT = LOAD_FILE (<str-expr>) Load file named in the string
LOAD_FILE will evaluate the string expression and will load the file with the resulting name. The name is expected to include the full path name.
The function returns a numeric value: 1 if the loading was successful, 0 if not. That way, the GPP2 program can take action in case the loading of the file failed. In case of failure, a runtime warning is issued as well.
The data from the loaded file will be sent to the "current" output file. In case of output redirection, it will be sent to the redirected output file.
Note: GPP2 supports a DF2 parameter that can force the output to be all lowercase or all uppercase. If that parameter is used, it also affects the loaded file data - it will all be converted to lowercase or uppercase respectively.
Example
RESULT = LOAD_FILE ("C:\Cimatron\MyData.txt");
IF (RESULT == 0) GPP_STOP; END_IF;
LOAD_FILE("C:\Cimatron\MyData.txt"); // Error! LOAD_FILE is a function
|