Imports System
Imports Microsoft.VisualBasic
Module Test
Dim i As Integer
Public Sub AddOne(ByVal InputArray() As Integer)
For i = 0 To 3
InputArray(i) = InputArray(i) + 1
Next
End Sub
Public Sub AddTwo(ByVal InputArray() As Integer)
Dim tempArray() As Integer
tempArray = InputArray.Clone
For i = 0 To 3
tempArray(i) = tempArray(i) + 2
Next
End Sub
Sub Main()
Dim intArray() As Integer = {6, 8, 7, 6}
For i = 0 To 3
Console.WriteLine("{0}", intArray(i))
Next
AddOne(intArray)
For i = 0 To 3
Console.WriteLine("{0}", intArray(i))
Next
AddTwo(intArray)
For i = 0 To 3
Console.WriteLine("{0}", intArray(i))
Next
End Sub
End Module
|