-->

VB.NET Infinite Parameters / Arguments for functions

04 2018
Function Total(ByVal ParamArray numbers As Integer()) As Integer
Total = 0
For Each i As Integer In nums
Total += i
Next
End Function   

Dim Number1 As Integer = Total(1,2)
Dim Number2 As Integer = Total(1,2,3)
Dim Number3 As Integer = Total(1,2,3,4)
Dim Number4 As Integer = Total(1,2,3,4,5)

Leave a Reply