The examples in the table below are based on a file found in this directory :
d:\incoming\program\argument\secondargument\subdir\spoolfile.txt
Note: these variables can also be used in the Environment property.
Variable | Explanation | Example |
---|---|---|
%BaseDirCount% | The current number of the basedir (as is mentioned in the config file). Will be blank for default dir | 1 |
%CurrentDate% | A numeric value indicating the Date | 20061015 |
%CurrentTime% | A numeric value indicating the Time | 1630 |
%TimeStamp% | A String value indicating the current Date/time | 20061015T20:30:15 |
%MyTimeStamp% | A String value indicating the current Date/time (depending on the value of FreeTimeStamp in the Config File) | 15/10/2006 |
%StartCount% | A Numeric value counting the number of commands executed | 20 |
%FileName%* | Name of the file that triggered the program (with the path, after the rename) | d:\incoming\program\ argument\secondargument\ subdir\~~spoolfile.txt |
%BaseDir%* | Basedir where the program has been looking for this file | d:\incoming\ |
%Level1%* | The Name of the directory under Basedir where the file came from | program |
%Level2%* | The Name of the directory under Level1 where the file came from | argument |
%Level3%* | The Name of the directory under Level2 where the file came from | secondargument |
%Level4%* | The Name of the directory under Level3 where the file came from | subdir |
%CurrentDir%* | Complete path where the file came from | d:\incoming\program\ argument\secondargument\ subdir\ |
%OriginalFile%* | Original name of the file before the rename happened (without the path. This file does not really exists anymore) | spoolfile.txt |
%OriginalFileNoExt%* | Original name of the file without the extension, without the path | spoolfile |
%OriginalExtention%* | Original extention of the file | txt |
%ProcessQueueID% | A numeric value indicating the Process Slot of this particular program. | 1 |
%Environment%& | A String value containing the environment for the current program | "spFILENAME=1110197", "spSTARTCOUNT=1", "spBASEDIRCOUNT=0" |
%CommandLine%& | A String containing the current commandline | "D:\batch\2120955183.bat" "1110197" DOETINCHEM |
%ExitValue%& | A numeric value containging the returning errorlevel of the called program, if this value is 9999 then the program was not found (only valid in StopSQL or ErrorSQL) | 0 |
%PreQueueResult%& | The (first) result value of the PreQueueSQL statement. | Unknown |
* in StartProgramDB, these fields only contain data when the BaseSQL statement contains fields with these exact name.
& has only a meaning in StartProgramDB after a succesful hit on BaseSQL
When you put values in the Config File you can also refer to them using the construnction IF the setting for OnlyProcessKnownVars is FALSE
In the Environment of the process there also is a variable called ProcessQueueID it refers to the slot in which the process is running. one progem can only run in one slot at a time, slots are reused. The value is form 0 to CreateProcess.MaxQueueCount - 1
The Examples have been moved to a separate page.