Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Make RAND() issue UNIQUE numbers?
Message
From
04/12/1997 22:58:38
 
 
To
04/12/1997 20:05:49
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00063913
Message ID:
00063939
Views:
52
Yeah, I was just hoping for something like RAND(,U) <-- a unique parameter.

I'm told that C++'s RAND() function returns unique numbers...

Oh well, I did the SEEK to verify uniqueness and it works fine.

Thanks

>This is normal. Random numbers are not unique.
>
>Each time you generate a new number you must do a SEEK and add it only if it is not already in your table.
>
>Vlad
>
>>I fill a file having 12000 records with 'random' numbers. Index on number unique
>>shows only 7550 unique numbers
>>
>>>What's the problem? Ie: What doesn't work?
>>>
>>>Vlad
>>>
>>>>We are using RAND() to create a random sampling of a phone number file so
>>>>we need unique numbers so we don't re-use phone numbers
>>>>
>>>>Any way?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform