以文本方式查看主题

-  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=150452)

--  作者:fubblyc
--  发布时间:2020/5/30 11:34:00
--  内部函数返回值
老师,

执行  一个内部函数 获取用户信息
Functions.Execute("获取用户信息")

获取用户信息 函数代码:
Dim openid2 As String
Dim _zhangtao As String
Dim _username As String
Dim _usergroup As String

openid2 = e.Cookies("openid")
Dim dr As DataRow = DataTables("用户数据表").sqlfind("openid = \'" & openid2 & "\'")
If dr IsNot Nothing Then
    _zhangtao = dr("账套")
    _usergroup = dr("group")
    _username = dr("name")
End If



怎么将获取到的_zhangtao 等信息传递出来呢?

Functions.Execute("获取用户信息")
希望接下去就 可以使用获取到的  _zhangtao  信息 

--  作者:有点蓝
--  发布时间:2020/5/30 11:37:00
--  
1、使用全全局变量
2、返回一个数组
Dim openid2 As String
Dim str(2) As String

openid2 = e.Cookies("openid")
Dim dr As DataRow = DataTables("用户数据表").sqlfind("openid = \'" & openid2 & "\'")
If dr IsNot Nothing Then
    str(0) = dr("账套")
    str(1) = dr("group")
    str(2) = dr("name")
End If

return str

调用
Dim str() As String = Functions.Execute("获取用户信息")