Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need suggestions for not so random number
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01084023
Message ID:
01084064
Views:
9
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform