以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何写class 并调用  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=189416)

--  作者:252476276
--  发布时间:2023/11/30 15:15:00
--  如何写class 并调用
如题,还是就写成单个的函数?
--  作者:有点蓝
--  发布时间:2023/11/30 15:32:00
--  
全局代码
Public Class test
    Public Function test(ByVal a As Long, ByVal b As Long) As Long
        Return a + b
    End Function
End Class

调用
dim a as new text
dim b as long = a.test(1,1)
msgbox(b)