以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  记录查看的人员名字  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=135835)

--  作者:cd_tdh
--  发布时间:2019/6/4 11:00:00
--  记录查看的人员名字
老师,我有个通知公告表,有一列记录查看的人员姓名,查看一次就把查看人员的姓名记录进去,不重复记录,怎么实现?
[此贴子已经被作者于2019/6/4 11:00:00编辑过]

--  作者:有点甜
--  发布时间:2019/6/4 11:26:00
--  

参考代码

 

Dim str As String = "abc,123,张三"
Dim s As String = user.name
Dim ary = str.split(",")
If array.Indexof(ary, s) < 0 Then
    str &= "," & s
End If
msgbox(str.trim(","))


--  作者:cd_tdh
--  发布时间:2019/6/4 11:41:00
--  

老师,这样没有把新的查看人增加进去呢。

Dim r As Row = Tables("通知公告").Current
Dim str As String = r("查看记录")
Dim s As String = _UserXingMing
Dim ary = str.split(",")
If array.Indexof(ary, s) < 0 Then
    str &= "," & s
End If
msgbox(str.trim(","))

[此贴子已经被作者于2019/6/4 11:40:44编辑过]

--  作者:有点甜
--  发布时间:2019/6/4 12:03:00
--  

Dim r As Row = Tables("通知公告").Current
Dim str As String = r("查看记录")
Dim s As String = _UserXingMing
Dim ary = str.split(",")
If array.Indexof(ary, s) < 0 Then
    str &= "," & s
End If
msgbox(str.trim(","))

r("查看记录") = str.trim(",")