Solved

# printing array values

Posted on 2006-11-28
Medium Priority
233 Views
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
Question by:ayha1999
• 2

LVL 48

Accepted Solution

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

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

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

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Integration Management Part 2
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
###### Suggested Courses
Course of the Month8 days, 1 hour left to enroll