Foxtable(狐表)用户栏目专家坐堂 → [求助]找最大值问题


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

主题:[求助]找最大值问题

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


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2015/8/8 7:39:00 [显示全部帖子]

最大
Dim t As Table = CurrentTable
Dim vals As List(Of String) = t.DataTable.GetValues("第一列","第一列 Is Not Null")
Dim max As Integer = 1
Dim str As String
For Each val As String In vals
    max = IIF(val.Split("】")(1).Split("号")(0) > max,val.Split("】")(1).Split("号")(0),max)
    If val.EndsWith(max & "号") Then
        str = val
    End If
Next
MessageBox.Show(str)
最小
Dim t As Table = CurrentTable
Dim vals As List(Of String) = t.DataTable.GetValues("第一列","第一列 Is Not Null")
Dim max As Integer = 1
Dim str As String
For Each val As String In vals
    max = IIF(val.Split("】")(1).Split("号")(0) < max,val.Split("】")(1).Split("号")(0),max)
    If val.EndsWith(max & "号") Then
        str = val
    End If
Next
MessageBox.Show(str)

 回到顶部