PARM varname, minlen=4, maxlen=8
# This script returns in the variable specified as "varname" a `random'
# name consisting of letters and numbers (cannot start with a number)
# at least "minlen" characters long and not more than "maxlen" chars.
#
# expression for a `random' letter:
setvar letter "chr((hpcpumsecs mod 26)+ord('A'))"
# expression for a `random' number:
setvar number "chr((hpcpumsecs mod 10)+ord('0'))"
# first character must be a letter
setvar !varname !letter
# now fill in the rest, must have at least "minlen" chars , up to "maxlen"
setvar i 1
setvar limit min((hpcpumsecs mod !maxlen)+!minlen, !maxlen)
while setvar(i,i+1) <= limit do
if odd(hpcpumsecs) then
setvar !varname !varname + !letter
else
setvar !varname !varname + !number
endif
endwhile