<-- Previous || Up || Next -->

Random File Prefix Function
File Names Class

Public Function RandomFilePrefix( _
    ) As String

Returns eight random characters which are all valid within DOS file names.
Useful for generating random DOS- and Windows-compatible file names.

    Rnd(-1) = 0.224007
    RandomFilePrefix = "~}Y^Z3&U"
    RandomFilePrefix = "~}Y`WZ%8"
See also:
    DOSFileNameCharacters Property
    RandomValues Class
Note: The call to the Visual Basic Rnd function in the above example seeds the Visual Basic random number generator so that the sample results can be reproduced. There is generally no need to call the Rnd function within your programs since Entisoft Tools initializes the Visual Basic random number generator once with "Randomize" statement.
Warning: This function is limited to using DOS-compatible file name characters in order to retain compatibility with DOS, Windows 3.0, and Windows 3.1. Consider using the RandomString function to generate a random file prefix if a different alphabet is required.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.