主题:排场程序,请教各位教师解决一下!急急急!!
有一个简单的排场程序,老师帮忙解释一这段代码,这段程序每次排的场是一样的,我想要每排一次都不一样,每次修改一下参数或代码也行,不知道修改哪个地方,急!!!
谢谢!!!
有需要可以给完整程序!!
LOCAL lcKc,lcZh,lcBmxh,lcXm,lcZkzh,lcRandom,lcXbdm,lckcs,lczhs,lcXqdm,lcXqmc,lcxh
lcKc=1
lcZh=1
lcXh=1
lcXqdm=thisform.Xq.Text.value
lcXqmc=thisform.Xq.ComBox.value
SELECT 0
Use Data\pck.dbf EXCLUSIVE alias Kc
Zap
Select * From Bmk Where Bmxh Not In (Select Bmxh From Kc) into Cursor Tm_临时表
lnKsCount = _TALLY
GO top
Do While lnKsCount >0
lcRandom=INT(MOD(Rand()*10000,lnKsCount))
If lcRandom=0
lcRandom=1
ENDIF
If lcRandom>lnKsCount
lcRandom=lnKsCount
ENDIF
Select Tm_临时表
GO top
Go lcRandom
lcBmxh=bmxh
lcXm=xm
lcXbdm=xbdm
lcZkzh=val(lcXqdm)*100000+lcxh
lcxh=lcxh+1
if lckc<10 then
lcKcs='00'+str(lckc,1)
endif
if lckc>=10 and lckc<=99 then
lcKcs='0'+str(lckc,2)
endif
if lckc>=100 then
lcKcs=str(lckc,3)
endif
if lczh<10 then
lczhs='0'+str(lczh,1)
else
lczhs=str(lczh,2)
endif
gcstatus=1
谢谢!!!
有需要可以给完整程序!!
LOCAL lcKc,lcZh,lcBmxh,lcXm,lcZkzh,lcRandom,lcXbdm,lckcs,lczhs,lcXqdm,lcXqmc,lcxh
lcKc=1
lcZh=1
lcXh=1
lcXqdm=thisform.Xq.Text.value
lcXqmc=thisform.Xq.ComBox.value
SELECT 0
Use Data\pck.dbf EXCLUSIVE alias Kc
Zap
Select * From Bmk Where Bmxh Not In (Select Bmxh From Kc) into Cursor Tm_临时表
lnKsCount = _TALLY
GO top
Do While lnKsCount >0
lcRandom=INT(MOD(Rand()*10000,lnKsCount))
If lcRandom=0
lcRandom=1
ENDIF
If lcRandom>lnKsCount
lcRandom=lnKsCount
ENDIF
Select Tm_临时表
GO top
Go lcRandom
lcBmxh=bmxh
lcXm=xm
lcXbdm=xbdm
lcZkzh=val(lcXqdm)*100000+lcxh
lcxh=lcxh+1
if lckc<10 then
lcKcs='00'+str(lckc,1)
endif
if lckc>=10 and lckc<=99 then
lcKcs='0'+str(lckc,2)
endif
if lckc>=100 then
lcKcs=str(lckc,3)
endif
if lczh<10 then
lczhs='0'+str(lczh,1)
else
lczhs=str(lczh,2)
endif
gcstatus=1