Initializes 2 dimensional array

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2007
Posts: 60
Reputation: evios is an unknown quantity at this point 
Solved Threads: 0
evios evios is offline Offline
Junior Poster in Training

Initializes 2 dimensional array

 
0
  #1
May 27th, 2008
How can i actually initializes a 2-dimensional array ALL to 0?

  1. Dim machinecount(,) As Integer

I try using 2 For loops to set it as 0 like the one shown but it gv me an error:

  1. For B = 0 To 23
  2. For C = 0 To 4
  3. machinecount(B, C) = 0
  4. Next
  5. Next

And i need to loop each argument to get a count....
for example....i want machinecount(1,2)++ ... something like this.....

can anyone help me? Thank You s much...
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 509
Reputation: selvaganapathy is an unknown quantity at this point 
Solved Threads: 88
selvaganapathy's Avatar
selvaganapathy selvaganapathy is offline Offline
Posting Pro

Re: Initializes 2 dimensional array

 
0
  #2
May 28th, 2008
Hi
I think by default it has zero value
u can use like this
Dim machinecount(,) As Integer

.....
machinecount = New Integer(23,4) {}
KSG
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 60
Reputation: evios is an unknown quantity at this point 
Solved Threads: 0
evios evios is offline Offline
Junior Poster in Training

Re: Initializes 2 dimensional array

 
0
  #3
May 28th, 2008
solved..thank You so much....reputation given...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the VB.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC