Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random generation
Message
From
13/05/2005 08:02:02
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01013774
Message ID:
01013799
Views:
11
Sergey

Sure. I thought I'd leave SOME programming for him, e.g if get same question again repeat; if record deleted repeat. I was just helping with the random no. bit. Of course, your soln is more elegant and concise.

>Terry
>
>It wouldn't work if there're deleted records and could pick the same record twice.
>
>>I've tested out the following:
>>
>>
>>For I = 1 to 150
>>  lnQuesKey = CEILING( INT( RAND() * 2500) )
>>* Fetch the question rec with lnQuesKey as PK
>>Endfor
>>
>>
>>Can't guarantee that it will give every no. from 1 to 2500 (without testing it an infinite no. of times!!!) but it seems to suffice, and HAS returned 1, and nos 1-10.
>>
- 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