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

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. Stream File
13. GUI
14. GUI Applications
15. 2D Graphics
16. I18N Internationlization
17. Reflection
18. Regular Expressions
19. Security
20. Socket Network
21. Thread
22. Windows
23. XML
24. Database ADO.net
25. Design Patterns
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
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
w___ww_.___j___a__v__a2__s__._c__om__ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.