以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]filter使用全局变量的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=187708)

--  作者:chnfo
--  发布时间:2023/8/5 22:55:00
--  [求助]filter使用全局变量的问题
表A把所有的表的加载条件都集中管理,里面用到了全局变量pubx
导航菜单名/表名/加载条件
菜单1/表一/iD = \'" & pubx & "\'  and Type =2
菜单2//表二 /iD = \'" & pubx & "\'

用WinForm.TreeView做导航菜单

AfterSelectNode事件


dim dr as datarow = datatables("表A").find("导航菜单名 = \'" & e.node.name & "\'")

if dr isnot nothing then 

maintable = tables(dr("表名"))

maintable.filter = dr("加载条件")

end if


但是加载条件文本,如何解析全局变量呢?



[此贴子已经被作者于2023/8/5 23:13:56编辑过]

--  作者:有点蓝
--  发布时间:2023/8/6 20:06:00
--  
没有办法解析

存储的内容建议改为这样:iD = \'【pubx】\'  and Type =2

然后替换:maintable.filter = dr("加载条件").replace("【pubx】",pubx)

[此贴子已经被作者于2023/8/6 20:06:17编辑过]

--  作者:chnfo
--  发布时间:2023/8/7 23:27:00
--  
哈哈,跟我想的办法一样。