.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> Collections >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Param array in vb.net

Posted By:satyapriyanayak       Posted Date: March 11, 2013    Points: 40    Category: Collections    URL: http://www.dotnetspark.com  

Param array in vb.net

Here we will know about param array (parameter array)


Condition of using this array

1.It must be the lone argument in the parameter declaration or it is used only once.

2.It is passed by call by value.

3.It must be the one dimensional array.

4.It must be the last argument in the parameter declaration.

5.A keyword param array is used after by val.



Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        sname("Student Name", "raj", "ravi", "abhijit", "rahul", "adarsh")

    End Sub

    Private Sub sname(ByVal s As String, ByVal ParamArray ar() As String)

        Dim i As Integer

        TextBox1.Text += s + vbCrLf

        For i = 0 To UBound(ar)

            TextBox1.Text += ar(i) + vbCrLf


    End Sub

End Class



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend