Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RAND() not very random
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01155607
Message ID:
01155648
Views:
31
Thanks Dawa

It seems I was missing the -1 seed from RAND(), as I've been admonished for not reading Help.

I'll take a closer look at your suggestion tommorrow. I don't know HOW random I NEED to be; the user isn't exactly producing copious numbers of these per day. It was just an expediant to save his naming each s/s o/p. But worth considering.

Cheers

Terry

...
>
>Terry,
>
>I ran a test and it seems that the randomness becomes more apparent when you 'zoom' the result of rand() with larger number. The test prg generates 1000 random numbers with the specified zoom level into a cursor "ccc", then extracts the unique numbers from "ccc" and creates a new cursor "ddd", by comparing the recccount() of the two cursors you're able to tell the generated numbers are unique or not. The prg is self-explanatory:
>
...
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Reply
Map
View

Click here to load this message in the networking platform