TZTJ 发表于 2008-2-19 11:43

数组问题

我能用以下代码把随机抽取出来的试题号保存到数组中去吗?
select st
recall all
For lnCnt=1 To tmun2
Do While .T.
    lnRecord=Int(Rand()*Reccount()+1)
    Go lnRecord
      If !Deleted()
      Delete
      Exit
    EndIf
  EndDo
EndFor
dime asth1(tmun2)
store 试题号 to asth1(tmun2)
另外,asth1(1),asth1(2).....asth1(tmun2)是不是表示第一个,第二个,......的试题号吗?

Tiger5392 发表于 2008-2-19 13:53

select st
recall all
Dimension asth1(tmun2)
For lnCnt=1 To tmun2
  Do While .T.
    lnRecord=Int(Rand()*Reccount()+1)
    Go lnRecord
    If !Deleted()
      Delete
      store 试题号 to asth1(lnCnt)
      Exit
    EndIf
  EndDo
EndFor

页: [1]

编程论坛