473,394 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Passing a Multi-Dimensional Array

I have looked all over and I cannot find an example or information on passing
a multi-dimensional array. Well, that is not true. I found a close example
in C++ but it didn't work when I "converted it" to VB.Net.

My receiving method looks like this:

Public DoIt(ByRef Array( , ) as string) as boolean

but what I am not clear on is what the parameter looks like in my calling
routine:

Dim result as boolean
result = DoIt(Array(???))

Thoughts?

--
Thanks,

Scott
Nov 21 '05 #1
3 9328
"SQLScott" <SQ******@discussions.microsoft.com> schrieb:
I have looked all over and I cannot find an example or information on
passing
a multi-dimensional array. Well, that is not true. I found a close
example
in C++ but it didn't work when I "converted it" to VB.Net.

My receiving method looks like this:

Public DoIt(ByRef Array( , ) as string) as boolean

but what I am not clear on is what the parameter looks like in my calling
routine:

Dim result as boolean
result = DoIt(Array(???))


\\\
Dim Data(2, 2) As Object
....
Foo(Data)

' Alternative.
Foo( _
New Object(2, 2) { _
{2, 3, 4}, _
{3, 4, 5}, _
{6, 7, 8} _
} _
)
..
..
..
Public Sub Foo(ByVal Data(, ) As Object)
...
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #2
Thanks Herfried. I was able to get it to work in my simple test app
beautifully, but when i tried to implement it in my Web Service, it returned
the following error:

WebService.MethodName can not be reflected.--> Multi-dimensional arrays are
not supported. Use a jagged array instead.

Oh well...back to the drawing board!

Scott

"Herfried K. Wagner [MVP]" wrote:
"SQLScott" <SQ******@discussions.microsoft.com> schrieb:
I have looked all over and I cannot find an example or information on
passing
a multi-dimensional array. Well, that is not true. I found a close
example
in C++ but it didn't work when I "converted it" to VB.Net.

My receiving method looks like this:

Public DoIt(ByRef Array( , ) as string) as boolean

but what I am not clear on is what the parameter looks like in my calling
routine:

Dim result as boolean
result = DoIt(Array(???))


\\\
Dim Data(2, 2) As Object
....
Foo(Data)

' Alternative.
Foo( _
New Object(2, 2) { _
{2, 3, 4}, _
{3, 4, 5}, _
{6, 7, 8} _
} _
)
..
..
..
Public Sub Foo(ByVal Data(, ) As Object)
...
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
Another related, but unresolved, issue.

vb.net 2002
A public multi-dimensional array(10,10,10) with public indices i,j,k in
Module1 does not pass information between forms. A one-dimensional
array(1000), or a scalar does. How come?
"SQLScott" wrote:
I have looked all over and I cannot find an example or information on passing
a multi-dimensional array. Well, that is not true. I found a close example
in C++ but it didn't work when I "converted it" to VB.Net.

My receiving method looks like this:

Public DoIt(ByRef Array( , ) as string) as boolean

but what I am not clear on is what the parameter looks like in my calling
routine:

Dim result as boolean
result = DoIt(Array(???))

Thoughts?

--
Thanks,

Scott

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Amr Mostafa | last post by:
Hello :) I'm trying to write a script that deals with a web service. I'm using NuSoap class. my question is : Can I pass some variables By Reference to the web service and get the result back...
1
by: Berend | last post by:
I am trying to pass multi values into a where clause with an in clause in a store procedure to use in a Crystal report. This can change depending on the user. Maybe there is another way to pass...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
2
by: Curtis Justus | last post by:
Hi, I currently have a control that is on a form and I want to pass that exact instance of the control to another form (a child form that appears on a button click). The control has state,...
2
by: Les Peabody | last post by:
Hello. I'm a rookie ASP VBScripter and am having a difficult time scripting the following scenario: I have an index.asp file that has a multi-line text box and a button of type button. When...
3
by: dice | last post by:
Hi, In order to use an external api call that requires a function pointer I am currently creating static wrappers to call my objects functions. I want to re-jig this so I only need 1 static...
3
by: blees10 | last post by:
Hi Everyone, I've seen this question posted before and I believe the answer was to incorporate VB code somewhere into the form. I am not familiar with VB and just wanted to know where to paste...
2
by: Smile | last post by:
Hi there, I have a question, please give me some idea. Thanks in advance! Solution1 | |---DBLogic (class library) | | | |-dblogic (class) which defines ConnString, functions to create...
4
by: John | last post by:
Hello All, Can someone help me with a problem I am having? I have a form which has a multi-select list where the user can select more than one company name from a list and I need to pass those...
0
by: Mark C. Stock | last post by:
"Mark C. Stock" <mcstockX@Xenquery .comwrote in message news:... | | "Berend" <Berend.Brinkhuis@evatone.comwrote in message | news:bdd9ac20.0401271301.22cdb65e@posting.google.com... | | I am...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.