以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  旧文件用新版打开后出现的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=135676)

--  作者:y2287958
--  发布时间:2019/5/31 17:34:00
--  旧文件用新版打开后出现的问题

 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:新版测试.table

 

附件打开后出现以下提示:

---------------------------
提示
---------------------------
找不到自定义函数"DrawCell"!
---------------------------
确定  
---------------------------

 

用旧版可以正常打开使用,如何解决这个问题?因为我之前的项目大量采用这个方式,一直都是非常正常好用的,谢谢版主。


[此贴子已经被作者于2019/6/1 8:01:11编辑过]

--  作者:有点甜
--  发布时间:2019/5/31 18:11:00
--  

 

打开你的项目,我测试没问题。请升级到最新版测试。

 

 


--  作者:y2287958
--  发布时间:2019/5/31 18:56:00
--  


图片点击可在新窗口打开查看此主题相关图片如下:tim图片20190531185239.png
图片点击可在新窗口打开查看

已经升级到最新版,仍然出现提示且无法关闭项目,最后只能强制退出。


--  作者:有点蓝
--  发布时间:2019/5/31 20:32:00
--  
\'\'\'
Dim e As Object = Args(0)
Dim 函数名称 As String = Args(1)
Dim dr As DataRow = DataTables("表A").Find("第一列 = \'" & 函数名称 & "\' and 第二列 is not null and 第二列 <> \'\'")
If dr IsNot Nothing
    If 函数集.Contains(函数名称)
        try
            Functions.Execute(函数名称, e)
        catch ex As exception
            函数集.Remove(函数名称)
        End try
    Else
        try
            函数集.Remove(函数名称)
            Functions.Remove(函数名称)
            Functions.Add(dr("第一列"), dr("第二列"))
            Functions.complie()
            函数集.Add(函数名称)
            Functions.Execute(函数名称, e)
        catch ex As exception
            函数集.Remove(函数名称)
        End try
    End If
End If

--  作者:y2287958
--  发布时间:2019/5/31 23:14:00
--  

版主,费心了。

用了以上代码仍然如此啊,再费点心看看呗


--  作者:有点蓝
--  发布时间:2019/5/31 23:22:00
--  
删除项目里的bin目录,重启项目测试
--  作者:y2287958
--  发布时间:2019/5/31 23:52:00
--  

谢谢版主有心,问题仍然存在。经深入测试,有以下情况:

表事件DrawCell有代码的情况下,如果表事件PrepareEdit也有代码便出现以上情况,其他则正常。

劳烦版主有空再帮帮忙,一方面解决一下问题,另一方面可以涨涨知识。


--  作者:y2287958
--  发布时间:2019/6/1 7:09:00
--  
删除Bin后,有时可以,尔后多打开几次后便又反复出现,不知道什么原因造成。
[此贴子已经被作者于2019/6/1 7:33:14编辑过]

--  作者:有点蓝
--  发布时间:2019/6/1 8:59:00
--  
我反馈下,等开发那边处理
--  作者:有点甜
--  发布时间:2019/6/4 17:28:00
--  

试试这样

 

\'\'\'
Dim e As Object = Args(0)
Dim 函数名称 As String = Args(1)

If 函数集.Contains(函数名称)
    try
        Functions.Execute(函数名称, e)
    catch ex As exception
        函数集.Remove(函数名称)
    End try
Else
    Dim dr As DataRow = DataTables("表A").Find("第一列 = \'" & 函数名称 & "\' and 第二列 is not null and 第二列 <> \'\'")
    If dr IsNot Nothing
        try
            函数集.Remove(函数名称)
            Functions.Remove(函数名称)
            Functions.Add(dr("第一列"), dr("第二列"))
            Functions.complie()
            函数集.Add(函数名称)
            Functions.Execute(函数名称, e)
        catch ex As exception
            函数集.Remove(函数名称)
        End try
    End If
End If