Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get a random password
Message
From
17/09/2003 16:00:38
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00830033
Message ID:
00830079
Views:
25
Funny, I thought I had corrected that. That was my first test, which I then tested in VFP.

Anyway, the other solution is better, since it allows to specify the permissible characters in an easy and flexible way.

>In line 5, Error 107: Operator/operand type mismatch. Maybe you mean This:
>
>LOCAL lcPassword, i
>lcPassword = ""
>rand(-1)
>FOR i = 1 TO 6
>  lcPassword = lcPassword + CHR(64 + int(26 * rand()))
>NEXT
>? lcPassword
>
>
>Added CHR() function.
>
>>>i want to generate a random password how can i do
>
>>Only uppercase letters, 6 characters:
>
>>local lcPassword, i
>>lcPassword = ""
>>rand(-1)
>>for i = 1 to 6
>>  lcPassword = lcPassword + 64 + int(26 * rand())
>>next
>>? lcPassword</i>
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform