@VERSION[filename[,separator[,start[,force][,prefix]]]] : Returns a serially "versioned" replacement for the file name. If the file doesn't exist, and force isn't set, @VERSION returns filename.
If filename is quoted, the returned filename will also be quoted (if necessary).
This is distinct from the function of @UNIQUE[] in that it retains the entire filename and only appends a version separator character and an ascending version number to the filename. @VERSION does not create the file; it just returns the next available version name.
@VERSION has four arguments:
filename | The filename to "versionize" (required) |
separator | The version separation character (optional, defaults to ';'). Note that the TCC-RT include list character is ;, so if you want to use ; in a filename, you will need to double quote the filename. |
start | The starting version number (if necessary to add a version number; optional, defaults to '1') |
force | The flag to force versioning, even if the file doesn't exist (optional, defaults to 0 or FALSE). |
prefix | If prefix is 0, @VERSION will append the version number to the end of the extension. If prefix is 1, @VERSION will prefix the version number to the extension. (Optional, defaults to 0). |
Examples:
echo %@version[myfile.txt]
myfile.txt;1
echo %@version[myfile.txt]
myfile.txt;2