Share via


SYS(3) - Legal File Name

Returns a legal file name that can be used to create temporary files.

SYS(3)

Return Values

Character

Remarks

SYS(3) may return a non-unique name when issued successively on a fast computer. Use SUBSTR(SYS(2015), 3) to create unique, legal eight character file name.

Note   Avoid using this string in CREATE TABLE, CREATE CURSOR, SELECT INTO CURSOR, and other similar commands. Using this string generates an error because a valid FoxPro cursor or alias name cannot begin with a number. If you have used SUBSTR(SYS(2015), 3) to create a unique table or cursor name without explicitly preceding the string with an underscore, (_), or alphabetic character, you can fix your code in the following ways:

  • On a platform that supports long file names
    Use SYS(2015) by itself since it always begins with an underscore.

  • On platforms and networks that support only the DOS 8+3 naming convention
    Change your naming expression to explicitly prefix an underscore as in the following example:

       "_"+SUBSTR(SYS(2015), 4)  
    

See Also

FILE( ) | SYS( ) Functions Overview | SYS(2015) - Unique Procedure Name