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

Random String Fast Function
Random Values Class

Public Function RandomStringFast( _
      ByRef vMinLength As Long _
    , ByRef vMaxLength As Long _
    , ByRef vAlphabet As String _
    ) As String

Returns a random string whose length is between vMinLength and vMaxLength characters inclusive and which will be composed of the characters in string vAlphabet.
Faster version of the RandomString function which has restrictive argument types and no argument validation.

Examples:
    Rnd(-1) = 0.224007
    RandomStringFast(0, 16, CryptoAlphabet) = ""
    RandomStringFast(0, 16, CryptoAlphabet) = "D"
    RandomStringFast(0, 16, CryptoAlphabet) = "OM "
    RandomStringFast(10, 10, CryptoAlphabet) = "JRDLBUKXHU"
    RandomStringFast(10, 10, CryptoAlphabet) = "PZKSLARUXW"
    RandomStringFast(10, 10, CryptoAlphabet) = "CZANUGPSZU"
    CryptoAlphabet = " ABCDEFGHIJKLMNOPQRSTUVWXYZ"
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.
See also:
    RandomString Function
    RandomVariant Function
    EveryCharacterOfType Function
vMinLength: Minimum length of the random string that will be returned. This argument is never modified even though it is passed by-reference.
vMaxLength: Maximum length of the random string that will be returned. This argument is never modified even though it is passed by-reference. Function returns an empty string if vMinLength > (is greater than) vMaxLength.

vAlphabet: String containing that the characters that will be used to compose the random string. This argument is never modified even though it is passed by-reference. Function returns an empty string if the alphabet vAlphabet is an empty string.

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