Solved

printing array values

Posted on 2006-11-28
3
179 Views
Last Modified: 2010-04-23
Hi,

How can print values of a two dimentional array? the follwoing fucntion returns an array how can print the result?

Private Function Perms(ByVal data As String) As String(,)

...

return Strings
End Function

ayha
0
Comment
Question by:ayha1999
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 100 total points
ID: 18027698
   Sub Main()
        Dim Strings As String(,) = New String(1, 2) {{"1", "2", "3"}, {"4", "5", "6"}}

        PtintArray(Strings)

    End Sub

    Sub PtintArray(ByVal array As String(,))
        Dim maxDim0 As Integer = UBound(array, 1)
        Dim maxDim1 As Integer = UBound(array, 2)
        For i As Integer = 0 To maxDim0
            For j As Integer = 0 To maxDim1
                Console.Write(array(i, j))
                Console.Write(" ")
            Next j
            Console.WriteLine()
        Next i
    End Sub
0
 
LVL 7

Author Comment

by:ayha1999
ID: 18027800
HI,

how can assign the following in an array an print it?

dim arr(,) as string = Perms("ABCD")

the result of the perm will return a two dim array.

ayha
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 18028073
Do you ask how to write function Perms or how to print its result?

If you already have Perms function, you can use PrintArray function from my first post by the following way:

PrintArray(Perms("ABCD"))

or:

dim arr as string(,) = Perms("ABCD")
PrintArray(arr)



0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now