Home All Groups Group Topic Archive Search About

Handing a multidimensional Array as parameter

Author
15 Dec 2006 9:41 AM
Jens
Hi,

I have a multidimensional Array (2 dimensions). I'd like to hand that over
to another function (respective another thread in another class, but that
should be the same, shouldn't it?).

Part of the calling function:
Dim StatCreator As New Statistik(Datei_Inhalt())

And the destination class:
Public Class Statistik

    Dim Array()() As String

    Public Sub New(ByVal MeinArray()() As String)
        Array = MeinArray.Clone
    End Sub

Problem: syntax. It won't let me do ...new Statistik(Datei_Inhalt()()... nor
Datei_Inhalt or anything else I've tried.

Does anyone know how that works?

Author
15 Dec 2006 10:51 AM
David Anton
A 2-dimensional array is specified MeinArray(,).
--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C#/VB to C++ converter
Instant Python: VB to Python converter


Show quoteHide quote
"Jens" wrote:

> Hi,
>
> I have a multidimensional Array (2 dimensions). I'd like to hand that over
> to another function (respective another thread in another class, but that
> should be the same, shouldn't it?).
>
> Part of the calling function:
>  Dim StatCreator As New Statistik(Datei_Inhalt())
>
> And the destination class:
> Public Class Statistik
>
>     Dim Array()() As String
>
>     Public Sub New(ByVal MeinArray()() As String)
>         Array = MeinArray.Clone
>     End Sub
>
> Problem: syntax. It won't let me do ...new Statistik(Datei_Inhalt()()... nor
> Datei_Inhalt or anything else I've tried.
>
> Does anyone know how that works?
Author
15 Dec 2006 11:30 AM
Jens
Great, thanks a lot! :-)
Author
15 Dec 2006 12:01 PM
tommaso.gastaldi@uniroma1.it
Hi jens,

you should probably read the difference about jagged and
multidimensional arrays.

there is a lot on the web. for instance:
http://www.informit.com/guides/content.asp?g=dotnet&seqNum=127&rl=1

Jens ha scritto:

Show quoteHide quote
> Hi,
>
> I have a multidimensional Array (2 dimensions). I'd like to hand that over
> to another function (respective another thread in another class, but that
> should be the same, shouldn't it?).
>
> Part of the calling function:
>  Dim StatCreator As New Statistik(Datei_Inhalt())
>
> And the destination class:
> Public Class Statistik
>
>     Dim Array()() As String
>
>     Public Sub New(ByVal MeinArray()() As String)
>         Array = MeinArray.Clone
>     End Sub
>
> Problem: syntax. It won't let me do ...new Statistik(Datei_Inhalt()()... nor
> Datei_Inhalt or anything else I've tried.
>
> Does anyone know how that works?