以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  内部函数问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=171760)

--  作者:cqlwsam
--  发布时间:2021/9/8 17:17:00
--  内部函数问题
我做了一个内部函数,名称为:患者筛选。函数的代码如下:

\'\'\'此函数返回患者筛选条件
Dim t1,t2,t3,t4,filter As String
t1 = Vars("PID")
t2 = Vars("xm")
If t1 > "" And t2 > "" Then
    If ValidPIN(t1) = True Then
        Dim d1 As Date = ReadBirthDay(t1)
        t3 = Format(d1,"yyyyMMdd")
    Else
        Dim i As Integer = t1.length
        t3 = t1.Substring(i-8)
    End If
    t3 = "\'*" & t3 & "*\'"
    filter = "[PatientsID] like " & t3 & " and [姓名]= \'" & Vars("xm") & "\'"
Else
    filter = ""
End If

现在在其它地方引用它,想获取filter的值。我的代码是:
Dim filter As String = Functions.Execute("患者筛选")
MessageBox.Show(filter)

messagebox显示为空,错在哪儿?谢谢!


--  作者:有点蓝
--  发布时间:2021/9/8 17:28:00
--  
没有返回这个值
……
   End If
    t3 = "\'*" & t3 & "*\'"
    filter = "[PatientsID] like " & t3 & " and [姓名]= \'" & Vars("xm") & "\'"
Else
    filter = ""
End If
return filter