Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Password generator
Message
 
To
20/07/2001 14:57:29
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00533282
Message ID:
00533313
Views:
29
>OK, I feel like I'm looking at a repeating # problem on an IQ test. I understand the concept, but why multiply by 25 if rand() is even or by 9 if not?
>


Ok.. ASCII a to z is chr(97) to chr(122) and since rand() returns a number between 0 and 1, then rand()* 25 will be a number between 0 and 25. 97+25 = 122. So when lnCnt is 1 or for all random even times, it will create a random letter in the range of a to z. Else it will do it in the range of chr(48) to chr(57) which is 0 to 9.
- Erik Niese-Petersen

Crazy Dane in USA.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform