Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Password generator
Message
 
À
20/07/2001 14:57:29
John Deupree
Long Term Care Authority
Tulsa, Oklahoma, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00533282
Message ID:
00533313
Vues:
17
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform