|
Added a few tweaks, hope that is ok 8-) def
allowed_chars( val ) output =
[] case val when 'u'
then output += ('A'..'Z').to_a when 'l'
then output += ('a'..'z').to_a when 'd'
then output += ('0'..'9').to_a when
'uld' output
+= ('A'..'Z').to_a output
+= ('a'..'z').to_a output
+= ('0'..'9').to_a else output
+= ('A'..'Z').to_a output
+= ('a'..'z').to_a end end # 'u' -
upper, 'l' - lower, 'd' - digit, 'uld' - alpha numeric # default
upper and lower case string def
random_text( length, val='ul' ) v = val output =
"" allowed =
allowed_chars( val )
length.times do output
<< allowed[ rand( allowed.length ) ] end output end --Mark From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Wood I recently posted this,
but I'll pop another copy here. On 10/4/05, Winston,
Phyllis H <[EMAIL PROTECTED]>
wrote: Alan Richardson has an excel spreadsheet using visual basic macros for
|
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
