Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random search in a table
Message
From
09/12/2004 17:11:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968006
Message ID:
00968151
Views:
7
>I am not sure why You need to use the Key for this, I would think that you leave your program open for an "endless" loop, for example your Key lenght allows 100.000.000 different records while you "only" have less than 2.000.000 records in the table, thus leaving a probability of 1/50 of getting a valid key.
>
>If you think that the select statement can be slow, why don't you just generate a random record number?
>
>
>Rand(-1)
>lnRecno	= Int(Rand() * Reccount('Table')) + 1
>go lnRecno in Table
>lcKey = Table.key
>
Hey Hugo

You're completelly right.. Pretty nice your solution.. Even better than Jim's solution for sure..

Thank you.. I already gave Jim the tree stars.. But, feel as you also got it !!

:)

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform