在VB6.0中,使用参数列表时,有一个ParamArray关键字,它是干什么的呀,有什么用?
ParamArray 用于过程最后的一个参数,表示该参数是包含任意个数元素的数组(Variant 类型)'ParamArray 不能与 ByVal、ByRef或 Optional 一起使用。Private Sub Command1_ClickDim d1 As Long, d2 As Longd1 = My1(5, 1, 2) '计算 5*(1+2)d2 = My1(5, 1, 2, 3, 4) '计算 5*(1+2+3+4)End SubPrivate Function My1(a As Long, ParamArray b) As LongDim S1 As Long, S2 As LongS1 = LBound(b): S2 = UBound(b)For I = S1 To S2My1 = My1 + b(I)NextMy1 = My1 * aEnd Function