Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

printing array values

Posted on 2006-11-28
3
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

722 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