Pass array : Array Parameters « Collections « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Collections » Array Parameters 
8.3.1.Pass array
Imports System
Imports Microsoft.VisualBasic

Module Test

  Dim As Integer

  Public Sub AddOne(ByVal InputArray() As Integer)
    For i = To 3
      InputArray(i= InputArray(i1
    Next
  End Sub
  Public Sub AddTwo(ByVal InputArray() As Integer)

    Dim tempArray() As Integer
    tempArray = InputArray.Clone
    For i = To 3
      tempArray(i= tempArray(i2
    Next
  End Sub
  
    Sub Main()
        Dim intArray() As Integer = {6876}

        For i = To 3
            Console.WriteLine("{0}", intArray(i))
        Next
        AddOne(intArray)

        For i = To 3
            Console.WriteLine("{0}", intArray(i))
        Next
        AddTwo(intArray)
        For i = To 3
            Console.WriteLine("{0}", intArray(i))
        Next
    End Sub

End Module
6
8
7
6
7
9
8
7
7
9
8
7
8.3.Array Parameters
8.3.1.Pass array
8.3.2.Passing arrays and individual array elements to procedures
8.3.3.Testing the effects of passing array references using ByVal and ByRef
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.