Sys(3), Sys(2015)
These two functions generate random strings. SYS(3) returns an 8-character string suitable for a filename. SYS(2015) returns a 10-character string handy for a procedure or function name—it was added in FoxPro 2.0 to allow GENSCRN, the 2.x screen generator, to generate procedure names for snippet code.
Usage |
cString = SYS(3) cString = SYS(2015) |
Example |
* Get a unique filename for a text file * On a busy network, you may want to try to FCREATE() * the file inside the loop to make sure someone else hasn't * just grabbed the same name. cFile = SYS(3) DO WHILE NOT FILE(cFile+".TXT") cFile = SYS(3) ENDDO |
See Also |