Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass multi-dimension array to a function

Status
Not open for further replies.

sony2000

Programmer
Dec 7, 2003
34
0
0
HK
Hi,

I have a 2-dimensional array, let say A(2,3) as integer and
a function func1(ByRef a() as integer), does anyone know
how to pass the 1st dimension array into the function? (just like the one we can do in language C )

e.g. pass A(0, 0), A(0, 1), A(0, 2) into the function

Hope you understand my question.

Thanks for your kind attention,
Raymond
 
Raymond,

Not sure how to do it the way you are wanting, except by having 3 variables in your function call and passing them in 1 at a time.

One thing you could try though in order to pass the entire row of the array in at once is as follows.

Declare your array as array(1,3)
Declare arraylst as ArrayList

Then put each array into a slot in the arraylist.

Then all you would need to do is pass in whatever elemnt of the arraylist you want and that would pass in the array that is stored there.

This is how i am keeping track of information and it is working very well.

Hope this helps,

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top