以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请问这个命令如何修改  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=169136)

--  作者:a272797388
--  发布时间:2021/6/4 7:08:00
--  请问这个命令如何修改
请问这个命令如何只适用筛选之后的表? 


Dim drs1 As List(Of DataRow) = DataTables("六年级").Select("paixu % 2 = 0","成绩 desc")
Dim drs2 As List(Of DataRow) = DataTables("六年级").Select("paixu % 2 = 1","成绩 desc")
Dim cnt As Integer = math.min(drs1.count,drs2.count)
Dim idx As Integer = 1
For i As Integer = 0 To cnt - 1
drs1(i)("排xu") = idx
idx += 1
drs2(i)("排xu") = idx
idx += 1
Next

If drs1.count > cnt Then
For i As Integer = cnt To drs1.count - 1
drs1(i)("排xu") = idx
idx += 1
Next
Else
For i As Integer = cnt To drs2.count - 1
drs2(i)("排xu") = idx
idx += 1
Next
End If

Tables("六年级").sort = "排xu"

--  作者:有点蓝
--  发布时间:2021/6/4 8:36:00
--  
Dim drs1 As List(Of DataRow) = DataTables("六年级").Select("paixu % 2 = 0 and " & Tables("六年级").filter,"成绩 desc")