FUNIQUE( )
Topic group Related topics Example
Creates a unique file name.
Syntax
FUNIQUE([<expC>])
<expC>
A file-name skeleton, using ? as the wildcard character (the * character is not allowed).
Description
Use FUNIQUE( ) when creating temporary files to generate a file name that is not being used by an existing file. The generated file name follows the file name skeleton you specify, with random numbers substituted for each ? character.
FUNIQUE( ) generates the new file name by replacing each wildcard character with a random number, then looking in the current or specified directory for a file name that matches the new file name. If no match is found, FUNIQUE( ) returns that name—but it does not create the file. If a match is found, FUNIQUE( ) tries again until a unique file name is found. If no combination of random numbers is successful, FUNIQUE( ) returns an empty string.
If you omit <expC>, FUNIQUE( ) returns an 8-character file name with no extension, composed entirely of random numbers, in the Windows temp directory.