| Option Strict On
Option Explicit On
Module ArrayDemo
Sub Sum(ByVal table() As Integer, ByRef result as Integer)
result = 0
For i as Integer = 0 To 9
result += table(i)
Next
End Sub
Sub Main()
Dim someNumbers(9) as Integer
Dim theSum as Integer = 0
For i as Integer = 0 To 9
someNumbers(i) = i * i
Next
Sum(someNumbers, theSum)
Console.WriteLine(theSum)
End Sub
End Module |
|
| | A Visual Basic Program with a procedure - Subprogram.
|