Foxtable(狐表)用户栏目专家坐堂 → 如何设置公式或编写代码统计?


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

主题:如何设置公式或编写代码统计?

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


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2015/8/29 19:17:00 [显示全部帖子]

参照这个
Dim dic As New Dictionary(of Integer,String)

Dim s() As String = {"输","输","赢","赢","输","输","赢","输","输"}
Dim i As Integer = 0
Dim count As Integer =0
Dim current As String
For Each s1 As String In s
    If s1<> current Then
        count = 1
        i+=1
        dic.Add(i,s1 & count)
        current = s1
    Else
        count +=1
        dic(i) = s1 & "|" & count
    End If    
Next
For Each k As Integer In dic.Keys '显示所有键及其对应的值
    Output.Show(K & ":" & dic(k))
Next

[此贴子已经被作者于2015/8/29 19:18:04编辑过]

 回到顶部