Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Random records
Message
De
26/12/2004 13:40:40
 
 
À
26/12/2004 07:12:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00972179
Message ID:
00972204
Vues:
14
>hi all,
>i want to insert to mynewtable total of records randomly
>as
>thisform.text1.value=778
>my code under copy this records but not randomly
>any idea.
>
>USE moh11
>COPY TO newmoh111 NEXT  (thisform.text1.value)
>
>thanks.
>m.qasem
use moh11
copy to newmoh111 next (thisform.text1.value)
...will copied the number of record(s) = thisform.text1.value from moh11 to newmoh111 starting from the current record in moh11


if you want random pick records from moh11 to newmoh111 ...maybe this will help you
SELECT moh11
gnlower = 1
gnupper = RECCOUNT()
mtop = thisform.text1.value
FOR ncnt = 1 TO mtop
   ranselect = Int(((gnupper - gnlower+1) * Rand() + gnlower))
   SELECT moh11
   GOTO ranselect
   SELECT newmoh111
   APPEND BLANK
   replace newmoh111.code WITH moh11.code, ... with ...,... with ...
   select moh11
endfor
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform