傳遞不明確陣列
不明確陣列可以用Array 來代表其型別,但不能使用ReDim 語法,會被Visual Basic 視為非陣列型態。
]Function test(ByVal testInput As Array)As Array //從Array 傳回值也是允許的。
]MsgBox(testInput(LBound(testInput)))
]ReDim testInput(0) //所有行為都和一般陣列相同,只有ReDim 語法不能使用。
]End Function
文章標籤
全站熱搜
不明確陣列可以用Array 來代表其型別,但不能使用ReDim 語法,會被Visual Basic 視為非陣列型態。
]Function test(ByVal testInput As Array)As Array //從Array 傳回值也是允許的。
]MsgBox(testInput(LBound(testInput)))
]ReDim testInput(0) //所有行為都和一般陣列相同,只有ReDim 語法不能使用。
]End Function