Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another question about Random password Generator
Message
From
28/07/1999 15:16:20
 
 
To
28/07/1999 15:10:11
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00247351
Message ID:
00247355
Views:
26
chr(65 + int(rand()*26)) will generate a single random letter from A to Z

Just slap that in where you want an alpha.

replace cvalue with chr(65 + int(rand()*26)) + padl(alltrim(str(1+1000*rand())), 4, "0") + chr(65 + int(rand()*26))

>
>CLOSE DATABASES
>CREATE table Random (cValue N(8))
>FOR nItem = 1 TO 200  && Append 200 records,
>  APPEND BLANK
>  REPLACE cValue WITH 1 + 1000 * RAND( )  && Insert random values
>next
>
>This gets me 200 records in a table consisting of a randomly created number.
>
>How about if I want to create this password using say an alpha character, followed by 4 numerics, then ending with another alpha.
>
>How do you generate the random letters?
>
>Thanks
--Todd Sherman
-Wake Up! Smell the Coffee!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform