请高手给出设计思路
我有这样一个需求:10组监考人员,10个考场,要求同一组在一个考场只能监考一次,下场考试必须更换考场,而且要随机分配监考哪场,在VFP中如何实现呢?大家说说看.
[解决办法]
试试:
*-- vfp9 代码Create Cursor 结果 (场次 N(3), ; 人员A C(6), 人员B C(6), 人员C C(6), 人员D C(6), 人员E C(6), ; 人员F C(6), 人员G C(6), 人员H C(6), 人员I C(6), 人员J C(6))For ii = 1 To 10 Insert Into 结果 (场次) Values (ii)EndforCreate Cursor t0 (ord N(10,4), 考场 C(1))Rand(-1)For ii = 1 To 10 Insert Into t0 (ord, 考场) Values (Rand(), Chr(Asc('A')+ii-1))EndforSelect * From t0 Into Cursor t1 Order By ord ReadwriteUse In t0Select t1Append From Dbf('t1')Replace All ord With Recno()Create Cursor t0 (ord N(10,4), 人员 C(1))For ii = 1 To 10 Insert Into t0 (ord, 人员) Values (Rand(), Chr(Asc('A')+ii-1))EndforSelect * From t0 Into Cursor t2 Order By ord ReadwriteUse In t0Select t2Replace All ord With Recno()For ii = 1 To 10 Select t2 Goto (ii) cSql = Textmerge([Update t set t.人员<<人员>>='考场'+t1.考场 from 结果 t inner join t1 on t.场次+<<ord-1>>=t1.ord]) &cSqlEndforUse In t1Use In t2Select 结果Browse