Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random Number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00585489
Message ID:
00585510
Vues:
17
>Hi all:
>
>How do I get a random number between 1 and 1000 in VFP6
>I could not find it in help.
>
>Thank you.
? INT(1000 * RAND( ) + 1)

* The code that generates random integers in the specified interval

lnRandMin = 1
lnRandMax = 1000

? INT((lnRandMax - lnRandMin + 1) * RAND( ) + lnRandMin)
Don't forget to use RAND(-1) to achieve the most random sequence of numbers.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform