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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding values in mult-dimensional arrays

Status
Not open for further replies.

morg27

MIS
Feb 4, 2002
16
US
I have a click event that should add the values in a multi-dimensional array. How should I go about doing this?
 
Just loop through all cells (for/next each inside another) and:

dim Sum as integer = 0
dim i,j as integer

For i=0 to ...
for j=0 to ...
sum +=myArray(i,j)
next j
next i

This is for 2-dim array. The main thing is: sum +=myArray(i,j)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top