以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  ParamArray 参数传递疑问  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=63495)

--  作者:打错潇洒
--  发布时间:2015/1/22 10:34:00
--  ParamArray 参数传递疑问

ParamArray  传递是数组参数

问题1: 如果我想循环产生一个参数 如何传递进去

Sub studentScores(ByVal ParamArray scores() As String)
    For i As Integer = 0 To UBound(scores, 1)
        Debug.WriteLine("Score " & i & ": " & scores(i))
    Next i
End Sub

传递一个 参数 dim s() as string = {"1","2"} 实际是 scores =  s 数组
我需要的是 s数组传递进去后 识别 为 scores("1","2")
如何将 s数组 转换为 scores() 的 数组参数 而不是数组类型




--  作者:Bin
--  发布时间:2015/1/22 10:36:00
--  
studentScores(s)

--  作者:打错潇洒
--  发布时间:2015/1/22 10:47:00
--  
为什么会这样子 是自动识别吗?
--  作者:Bin
--  发布时间:2015/1/22 10:48:00
--  
可以这么理解