hello..
i've got a problem when i want to pull some random records from a table.. well. it is randomize.. but the problem is.. it's always random in the same sequences.. like example it's always take the records number 9, 6, 10, 3, 8... and so on.. and it's always exactly the same sequences..
this is the coding that i use to randomize the records..
********************************************
SELECT quiz
DO WHILE NOT nRandom=vmisc.jmlsoal
nRandom=nRandom+1
SELECT quiz
nRecord = ROUND(1+(FLOOR(RAND() * RECCOUNT())), 0)
GOTO nRecord
SELECT jawab
LOCATE FOR quiz.id_soal = jawab.id_soal
IF FOUND()
nRandom = nRandom - 1
ELSE
GOTO nRecord IN quiz
SELECT jawab
APPEND BLANK
REPLACE jawab.id_soal WITH quiz.id_soal
REPLACE jawab.soal_quiz WITH quiz.soal_quiz
REPLACE jawab.gambar_soal WITH quiz.gambar_soal
REPLACE jawab.jawaban WITH quiz.jawaban
ENDIF
ENDDO
********************************************
i'm using vfp 8.. and when i use rand() every first time i start vfp 8, it's always shows the same sequences..
now, how will i randomize the records without having the same sequences..
could a SYS(2015) help me?? and what is the best way to use it..
thankyou very, very much for your attention guys..
i've got a problem when i want to pull some random records from a table.. well. it is randomize.. but the problem is.. it's always random in the same sequences.. like example it's always take the records number 9, 6, 10, 3, 8... and so on.. and it's always exactly the same sequences..
this is the coding that i use to randomize the records..
********************************************
SELECT quiz
DO WHILE NOT nRandom=vmisc.jmlsoal
nRandom=nRandom+1
SELECT quiz
nRecord = ROUND(1+(FLOOR(RAND() * RECCOUNT())), 0)
GOTO nRecord
SELECT jawab
LOCATE FOR quiz.id_soal = jawab.id_soal
IF FOUND()
nRandom = nRandom - 1
ELSE
GOTO nRecord IN quiz
SELECT jawab
APPEND BLANK
REPLACE jawab.id_soal WITH quiz.id_soal
REPLACE jawab.soal_quiz WITH quiz.soal_quiz
REPLACE jawab.gambar_soal WITH quiz.gambar_soal
REPLACE jawab.jawaban WITH quiz.jawaban
ENDIF
ENDDO
********************************************
i'm using vfp 8.. and when i use rand() every first time i start vfp 8, it's always shows the same sequences..
now, how will i randomize the records without having the same sequences..
could a SYS(2015) help me?? and what is the best way to use it..
thankyou very, very much for your attention guys..