Foxtable(狐表)用户栏目专家坐堂 → 自定义函数有误,如何修改?


  共有2499人关注过本帖树形打印复制链接

主题:自定义函数有误,如何修改?

帅哥哟,离线,有人找我吗?
blackzhu
  1楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:狐仙 帖子:9879 积分:57634 威望:0 精华:15 注册:2008/9/1 9:45:00
  发帖心情 Post By:2015/7/23 8:35:00 [显示全部帖子]

Dim strr As String = Args(0)
Dim kms() As String = strr.split(",")
Dim tb As Table = Args(1)
Dim pm As List(Of String()) = tb.DataTable.GetValues("年级|选做","")
Dim pmc As Integer
Dim TotalName As String
tb.Redraw = False
For Each km As String In kms
    For i As Integer = 0 To pm.Count -1
        If pm(i)(0) = "" Then
            Continue For
        End If
        Dim drs As List(Of DataRow) = tb.DataTable.Select("[年级] = '" & pm(i)(0) & "'And [选做] = '" & pm(i)(1) &  "'", km & " DESC") '字符型
        pmc = 0
        TotalName = km & "名次"
        For n As Integer = 0 To drs.Count - 1
            pmc = pmc +1
            If n > 0 AndAlso drs(n)(km) = drs(n-1)(km) Then
                drs(n)(TotalName) = drs(n-1)(TotalName)
            Else
                drs(n)(TotalName) = pmc
            End If
        Next
    Next
Next
tb.Redraw = True

Functions.Execute("选做题科目名次",填入的列名(也就是函数中km),Tables("语文"))
执行函数  
[此贴子已经被作者于2015/7/23 8:36:09编辑过]

 回到顶部