Foxtable(狐表)用户栏目专家坐堂 → [求助]关于表格结果判定问题


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

主题:[求助]关于表格结果判定问题

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/4/8 9:34:00 [显示全部帖子]

 

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:表达式判断.table


 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/4/19 9:21:00 [显示全部帖子]

Select Case e.DataCol.name
    Case "标准", "结果"
        Dim str As String = e.DataRow("标准")
        If str = Nothing OrElse e.DataRow.IsNull("结果") Then
            e.DataRow("判定") = Nothing
        Else
            Dim fhs() As String = {">", "=", "<"}
            Dim ary() As String
            For Each f As String In fhs
                If str.Indexof(f) Then
                    If str.IndexOf("x") >= 0 Then
                        ary = str.split("x")
                    Else
                        ary = new String() {str}
                    End If
                    str = "pass"
                    For Each s As String In ary
                        Dim flag = False
                        For Each fh As String In fhs
                            If s.IndexOf(fh) = s.Length-1 Then
                                flag = True
                            End If
                        Next
                        Dim ns As String = iif(flag=True, s & e.DataRow("结果"), e.DataRow("结果") & s)
                        Functions.remove("函数")
                        Dim Code As String
                        Code = "return " & ns
                        Functions.Add("函数",Code)
                        Functions.Complie()
                        Dim result = Functions.Execute("函数")
                        If result = False Then
                            str = "fail"
                        End If
                    Next
                    e.DataRow("判定") = str
                    Exit For
                End If
            Next
        End If
End Select

 回到顶部