Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random search in a table
Message
De
09/12/2004 10:19:10
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
 
À
09/12/2004 09:31:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
00968006
Message ID:
00968015
Vues:
10
This message has been marked as a message which has helped to the initial question of the thread.
Claudio,

You can use something like this:
LOCAL lcNumber, llExists

RAND(-1)

DO WHILE NOT llExists
   lcNumber = PADL(INT(RAND()*100000000),8,'0') 
   llExists = SEEK(lcNumber,'cTableAlias')
ENDDO    
HTH,
>Hello
>
>I need to create a procedure to raffle (randon) N records (by it keys) among the area/records in a table..
>
>For example.. I'd like to get 3 randon items of the list below.. Different on each time that I run my procedure..
>
>00000124
>00000334
>00000454
>00000455
>00001888
>00001993
>00030001
>00045540
>00012222
>00344445
>00554442
>
>Does anyone could help me on it, please ?
>
>TIA
>
>Claudio
Jim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform