这样可否:考场号与抽签名分片处理,对于某一片区先将抽签名乱序,再将考场号顺序分配给抽签名,以达到随机抽签的效果。
示例:只考虑一个片区
****** test.prg ******
CREATE CURSOR tt (考场号 I, 抽签名 C(10))
FOR i=1 TO 10
INSERT INTO tt (抽签名) VALUES ("抽签名"+TRANSFORM(i))
ENDFOR
GO TOP
of = CREATEOBJECT('Form1')
of.show(1)
RETURN
DEFINE CLASS form1 as form
ADD OBJECT cmd1 as commandbutton WITH top=10,left=10,height=22,caption="抽签"
ADD OBJECT grid1 as grid WITH top=50,left=10,RecordSourceType=1,RecordSource="tt"
PROCEDURE cmd1.click
INDEX on RAND() TAG 抽签
n = 1
SCAN
REPLACE 考场号 WITH n
n = n + 1
ENDSCAN
INDEX on 考场号 TAG 考场
GO TOP IN "tt"
thisform.grid1.setfocus
ENDPROC
ENDDEFINE