WORKINGDIR Change local default (working) folder |
Top Previous Next |
This script command defines the default folder for all file oriented script commands. Anytime a file name is specified in a command without a full path associated with it, FileLink either searches for or creates this file in the designated working folder. The selection made in this command overrides the default selection set with the FileLink configurator.
The current working folder is always maintained in the %currentlocaldir variable.
Consider the following example.
;; read record in "c:\Program Files\FileLink\example.txt" WORKINGDIR "c:\Program Files\FileLink" READLINE "example.txt" first_record
If a partial path is specified, it and the previous working folder are used to define the new working folder.
;; current working folder is "c:\Program Files\FileLink" WORKINGDIR "test" ;; new working folder is now "c:\Program Files\FileLink\test"
If “..” is specified, the new working folder is set one folder above the previous working folder.
;; current working folder is "c:\Program Files\FileLink" WORKINGDIR ".." ;; new working folder is now "c:\Program Files"
Caution The directory change made by WORKINGDIR is global within the FileLink script environment. If WORKINGDIR is going to called in a function or a called script, it is always recommended that the current working folder be saved on entry and restored on exit if it is going to be changed. See the description of the %currentlocaldir variable for an example of this.
Related Command(s): ARCHIVEDIR, MAKEDIR
|