以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  case语句问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=58504)

--  作者:luodang2050
--  发布时间:2014/10/17 17:06:00
--  case语句问题

以下代码通过函数取得s多字符串,其格式为: “A”,“B”

当判断值为A时,为啥不起作用?

\'table权限统一设置
Dim s As String =Functions.Execute("获取所有已设置表名")
MessageBox.Show(s)
For Each t As Table In Tables
    Dim tname  As String = t.Name
    Select Case tname
        Case s
            t.Visible = False
            If user.Type = UserTypeEnum.User
                t.AllowEdit = False
            Else
                t.AllowEdit = True
            End If
        Case Else
            If user.Type = UserTypeEnum.User
                t.Visible = False
                t.AllowEdit = False
            Else
                t.Visible = True
                t.AllowEdit = True
            End If
    End Select
Next


--  作者:Bin
--  发布时间:2014/10/17 17:08:00
--  
区分大小写的,注意一下.  代码没问题, 搞不定上例子看看
--  作者:luodang2050
--  发布时间:2014/10/17 17:10:00
--  
通过 Output.Show(s) 输出文本,替代上面的“case s”,就可以执行成功,是case本身功能的限制?
--  作者:有点甜
--  发布时间:2014/10/17 17:13:00
--  
  那就是大小写问题,注意下。