I have a file that i need to populate. For example.
530 of the records need to have '25'
264 of the records need to have '50'
211 of the records need to have '100'
The numbers have to be exact, but they have to be random. i am doing it a rather wierd way, however it does work just slow. any ideas? this is how i am doing it.
for q=1 to 530
use A01_temp
count to nRecordsLeft
store int(1+nRecordsLeft*rand())-1 to nRandom
set filter to recno()=nRandom
if recno()<=0
set filter to recno()=1
endif
replace all Occupy with '25'
erase tempfile.dbf
copy to tempfile
delete all
pack
use A01_long
append from tempfile
next
then i repeat for each value.
530 of the records need to have '25'
264 of the records need to have '50'
211 of the records need to have '100'
The numbers have to be exact, but they have to be random. i am doing it a rather wierd way, however it does work just slow. any ideas? this is how i am doing it.
for q=1 to 530
use A01_temp
count to nRecordsLeft
store int(1+nRecordsLeft*rand())-1 to nRandom
set filter to recno()=nRandom
if recno()<=0
set filter to recno()=1
endif
replace all Occupy with '25'
erase tempfile.dbf
copy to tempfile
delete all
pack
use A01_long
append from tempfile
next
then i repeat for each value.