 |
VFP 愛用者社區 本討論區為 Visual Foxpro 愛用者經驗交流的地方, 請多多利用"搜尋"的功能, 先查看看有無前例可循, 如果還有不懂的再發問. 部份主題有附加檔案, 須先註冊成為社區居民才可以下載.
|
上一篇主題 :: 下一篇主題 |
發表人 |
內容 |
yeer
註冊時間: 2005-02-18 文章: 3
第 1 樓
|
發表於: 星期三 二月 23, 2005 2:27 pm 文章主題: 这个程序那里错了,请指正!!! 好像存在别名问题!! |
|
|
select * from tiku;
where 难度="1" into cursor nd1
for i = 1 to 30
sele 1
use nd1
copy stru to nd3
sele 2
use nd3
select 1
pnum=reccount() &&表3的总记录数
prand=Rand()*pnum
select 2
append from 表1 for recno() = prand
close all
endfor
select * from tiku;
where 难度="2" into cursor nd2
for i = 1 to 40
sele 1
use nd1
copy stru to nd4
sele 2
use nd4
select 1
pnum=reccount() &&表4的总记录数
prand=Rand()*pnum
select 2
append from 表1 for recno() = prand
close all
endfor
select * &&将两个表合并成一个表
into nd5 && 生成考试纸表 作为考试界面的数据源
from nd3,table4
delect cursor nd3
delect cursor nd4 |
|
回頂端 |
|
 |
Le1015
註冊時間: 2004-08-06 文章: 30
第 2 樓
|
發表於: 星期三 二月 23, 2005 5:10 pm 文章主題: |
|
|
tiku,nd1這兩個是檔案嗎?
這段程式在做什麼用的 |
|
回頂端 |
|
 |
Le1015
註冊時間: 2004-08-06 文章: 30
第 3 樓
|
發表於: 星期四 二月 24, 2005 10:20 am 文章主題: |
|
|
真的有一點看不懂
幫你修正一下
假設 表1,tiku都是檔案
*是不是資料庫亂數取出30筆資料
Select 3
Use tiku
select * from tiku where 難度="1" into cursor nd1
AFields(DBFStru)
Create Cursor nd3 Array DBFStru
Create Cursor nd4 Array DBFStru
Create Cursor nd5 Array DBFStru
Select nd1
pnum=reccount()
for i = 1 to 30
prand=Int(Rand()*pnum)
select nd3
append from 表1 for recno() = prand
endfor
Use In
select * from tiku;
where 難度="2" into cursor nd2
&&是不是資料庫亂數取出40筆資料
select nd2
pnum=reccount()
for i = 1 to 40
prand=Int(Rand()*pnum)
select nd4
append from 表1 for recno() = prand
endfor
Select nd5
Append From DBF("nd3")
Append From DBF("nd4")
copy to nd5.dbf
close all |
|
回頂端 |
|
 |
|
|
您 無法 在這個版面發表文章 您 無法 在這個版面回覆文章 您 無法 在這個版面編輯文章 您 無法 在這個版面刪除文章 您 無法 在這個版面進行投票 您 無法 在這個版面附加檔案 您 無法 在這個版面下載檔案
|
|