以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  分组系列  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=157449)

--  作者:a272797388
--  发布时间:2020/10/16 13:57:00
--  分组系列

Dim t As Table = Tables("初二汤原考点")
Dim a As Integer = t.rows.count
Dim b As Integer = a - Math.Floor(a / 30)
Dim idx As Integer = 1
For i As Integer = 0 To b Step 30
    For j As Integer = 0 To 29
        t.Rows(i+j)("考场") = Format(idx,"00")
    Next
    idx += 1
Next
idx-=1
For i As Integer = b+1 To a - 1
    t.Rows(i)("考场") = Format(idx,"00")
Next

 

我想每30个人一个考场, 到37考场30后,应该38考场了, 可是命令还是往下排,请问是哪的毛病


图片点击可在新窗口打开查看此主题相关图片如下:89.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2020/10/16 14:04:00
--  
去掉idx-=1
--  作者:a272797388
--  发布时间:2020/10/16 14:17:00
--  还是多出了30啊

去了dx. 还是不对啊


图片点击可在新窗口打开查看此主题相关图片如下:火火.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2020/10/16 14:27:00
--  
Dim t As Table = Tables("表A")
Dim a As Integer = t.rows.count
Dim cn As Integer = 30
Dim b As Integer = Math.Floor(a / cn) * cn
Dim idx As Integer = 1
Output.Show(b)
For i As Integer = 0 To b-1 Step cn
    For j As Integer = 0 To cn - 1
        Output.Show(i+j)
        t.Rows(i+j)("组号") = Format(idx,"00")
    Next
    idx += 1
Next
idx-=1
For i As Integer = b To a - 1
    Output.Show(i)
    t.Rows(i+j)("组号") = Format(idx,"00")
Next