以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]字典集合定义错误  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=114720)

--  作者:blsu33
--  发布时间:2018/2/14 22:19:00
--  [求助]字典集合定义错误
老师,
下面的代码出错,是否定义有问题

MessageBox.Show(1)
            vars("p1_pidx") =new Dictionary(Of String,List(Of String))\'窗口按钮数组
MessageBox.Show(2)
            Vars("p1_pname")=New Dictionary(Of String,String)\'
MessageBox.Show(3)
            vars("p1_ymjz") = New Dictionary(Of String,List(Of String))\'窗口页面加载一次使用
MessageBox.Show(4)
            vars("p1_kjjz") = New Dictionary(Of String,List(Of String))\'窗口控件加载一次使用
            vars("p1_cdjz") = New Dictionary(Of String,List(Of String))\'窗口控件加载一次使用
MessageBox.Show(5)
            vars("p1_pcanl") =New Dictionary(Of String,List(Of String))\'窗口页面未完成登记不能切换范围
MessageBox.Show(6)
            \'vars("p1_pcanl").clear
MessageBox.Show(7)
            vars("p1_tlff") = New Dictionary(Of String,List(Of String))\'添加方法一次使用
MessageBox.Show(8)
            \'vars("p1_ymjz").clear
            Select Case frmname
                Case "serevmain"
                    vars("p1_pcanl").add("serevmain","JD0101")




--  作者:blsu33
--  发布时间:2018/2/14 22:19:00
--  
提示 3 后显示
Overload resolution failed because no Public \'<>\' can be called with these arguments:
    \'Public Shared Operator <>(a As String, b As String) As Boolean\':
        Argument matching parameter \'a\' cannot convert from \'Dictionary(Of String,String)\' to \'String\'.

显示 8 后提示
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2017.12.31.1
错误所在事件:自定义函数za_ck_afterload
详细错误信息:
Exception has been thrown by the target of an invocation.
Method invocation failed because \'Public Overrides Sub Add(key As String, value As System.Collections.Generic.List(Of String))\' cannot be called with these arguments:
    Argument matching parameter \'value\' cannot convert from \'String\' to \'List(Of String)\'.
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2017.12.31.1
错误所在事件:窗口,serevmain,SizeChanged
详细错误信息:
Overload resolution failed because no Public \'<>\' can be called with these arguments:
    \'Public Shared Operator <>(a As String, b As String) As Boolean\':
        Argument matching parameter \'a\' cannot convert from \'Dictionary(Of String,String)\' to \'String\'.
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2017.12.31.1
错误所在事件:窗口,serevmain,SizeChanged
详细错误信息:
Overload resolution failed because no Public \'<>\' can be called with these arguments:
    \'Public Shared Operator <>(a As String, b As String) As Boolean\':
        Argument matching parameter \'a\' cannot convert from \'Dictionary(Of String,String)\' to \'String\'.
[此贴子已经被作者于2018/2/14 22:20:24编辑过]

--  作者:新福星
--  发布时间:2018/2/15 10:28:00
--  
请细细看看字典的使用方法。
http://www.foxtable.com/webhelp/scr/1945.htm

--  作者:有点甜
--  发布时间:2018/2/21 20:37:00
--  

vars("p1_pcanl").add("serevmain","JD0101")

 

你定义的是下面,第二个参数必须是list,你写的是字符串

 

vars("p1_pcanl") =New Dictionary(Of String,List(Of String))\'窗口页面未完成登记不能切换范围