Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Random records
Message
From
26/12/2004 13:40:40
 
 
To
26/12/2004 07:12:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00972179
Message ID:
00972204
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform