Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need suggestions for not so random number
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01084023
Message ID:
01084064
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
>>
>>Just a guess:
>>
>>? MyRandom(382622)
>>
>>
>>FUNCTION MyRandom(lnSeed)
>>RETURN m.lnSeed + (DATETIME()-datetime(1900,1,1,0,0,0))
>>
>
>Something I don't understand. Please help me.
>
>How do you equate the number returned by MyRandom() function to the seed number?

Oops, that part of the question I skipped :o)
Sorry, something like:
lnRandom = MyRandom(382622)
? "Random", lnRandom.RandomNumber
? "Seed", lnRandom.RandomNumber - lnRandom.GetBack


FUNCTION MyRandom(lnSeed)

    LOCAL loEmpty
    loEmpty = CREATEOBJECT("Empty")
    ADDPROPERTY(loEmpty,"RandomNumber",0)
    ADDPROPERTY(loEmpty,"GetBack",0)
    loEmpty.GetBack = (DATETIME()-datetime(1900,1,1,0,0,0))
    loEmpty.RandomNumber = m.lnSeed + loEmpty.GetBack

RETURN loEmpty
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform