random string, random letters

Prev Next

Function Names

random string, random letters

Description

This function creates a string containing random upper-case characters from A..Z and digits 0..9. The function random letters generates strings with upper-case characters from A..Z only.

Call as: function

Restrictions

Indirect parameter passing is disabled

Parameter count

1

Parameters

No.TypeDescription
1
input
numeral character count

Specifies the number of random characters in the string.

Return value

TypeDescription
string Generated random string

Exceptions

Invalid character code (outside 0 - 1114111 range)

Examples

  for (i[] = 1, i[] <= 5, i[]++)
  {
      echo( random string( 10 ), " ", random letters( 10 ) );
  }

Output

RWEVB8K7G3 XTDCFFWXRG
OJTAOZ5FK3 INUIAIVBWM
8UY9NMP547 GUAAMANVJV
NA1S0UNL3G NFZHBTSEPW
PRO0J7TB8A AJSNALUWQZ
Try it yourself: Open LIB_Function_random_string.b4p in B4P_Examples.zip. Decompress before use.

See also

random