$Variables
All non-interactive DocOrigin programs use a common command-line processor. This includes the availability of a number of $X folder mapping settings that are used as shortcuts for various file paths. See $X String Substitutions. The $ variables tend to be defaulted in the standard .prm files that come with the DocOrigin system but can be redefined by you. These variables are all automatically defined within the DocOrigin JavaScript system as pre-defined javascript variables.
For example, in a typical DocOrigin installation $F is a shortcut to the forms folder (C:/DocOrigin/User/Forms on Windows).
var mfile = $F + "/myfile.txt"; var mfile2 = "C:/DocOrigin/User/Forms/myfile.txt"; // same as mfile
Note that if the string is to be used in a context where a file name is expected then you can actually embed the $X reference in the string. E.g. var fp = _file.fopen("$O/myFile.ini");
. That is, you can avoid the tedium of $X + "..." concatenation constructs. It is highly recommended that you make use of these $ variables when designing your scripts as they will create code that is easier to manage when moved to a different computer system. The makers of DocOrigin promise never to use $V, $W, $X, $Y, or $Z. You may use those without fear of a subsequent release coming along and redefining their meaning.
Defaults:
$var | Meaning |
---|---|
$R | Your installation folder -- never override this! |
$E | Where the current executable resides -- set automatically, do not override |
$N | The base name of the executable, e.g. Merge, RunScript, ... It is set automatically. Do not stray from this meaning. |
$B | The current directory at the very beginning of execution. The code sets this for you but does not itself reference it. |
$U | Where the User folder tree is; ($R/User) -- we wish that you not override this. The meaning itself is fixed. |
$C | Where the *user* configuration files are. This is the meaning that $C has, where you define it to point to is your business. |
$L | Where log files are to be kept. Set as you like, but make sure it has this stated meaning. |
As of 3.0.001.11...
$var | Meaning |
---|---|
$$F | Where the current form resides, not forms in general, but the current form. (Merge-only). |
$$D | Where the current data file resides, not data files in general, but the current data file. (Merge-only). |
$$X | Re FilterEditor: In a .xfilter file refers to the location of the .xfilter file |