Click here to Skip to main content
16,006,475 members
Home / Discussions / C#
   

C#

 
GeneralRe: Progress Bar Pin
Lash206-Oct-04 4:02
Lash206-Oct-04 4:02 
GeneralRe: Progress Bar Pin
Dave Kreskowiak6-Oct-04 13:06
mveDave Kreskowiak6-Oct-04 13:06 
General"NO Such interface supported" C# to Excel Pin
Ruchi Gupta5-Oct-04 11:20
Ruchi Gupta5-Oct-04 11:20 
GeneralLog to Access database from C# Pin
hans175-Oct-04 10:15
hans175-Oct-04 10:15 
Generalprinting with c# Pin
Member 12961365-Oct-04 9:01
Member 12961365-Oct-04 9:01 
GeneralRe: printing with c# Pin
Anonymous5-Oct-04 14:28
Anonymous5-Oct-04 14:28 
GeneralRe: printing with c# Pin
Member 12961367-Oct-04 7:06
Member 12961367-Oct-04 7:06 
GeneralUsing ArrayList in C sharp Pin
aussi5-Oct-04 8:59
aussi5-Oct-04 8:59 
Hi I need to make use a data structure to save a 2D data, let say node_id and node_status and later on I need to manipulate the node_status as necessary. Then I need to count down the nodes as per their staus. Let say the number of nodes whose shatus are 'off', and the rest, whose status are 'on' Should I use an ArrayList ? or an array ? In each case, how do I store, manipulate and search thorugh...and the problem is I am having trouble where/how to collect data into the ArrayList or array.

Thanks. here goes the part of code where I am having problem to implement the data sturcture:

  int i;<br />
int num;<br />
int numsect;<br />
			<br />
	num = NUM_NODES;<br />
	ArrayList nbuffer = new ArrayList();<br />
	for(i=0; i < num; i++) <br />
	{ // for each node<br />
	  int j;<br />
	  numsect = nodes[i].sector_info.numsect;<br />
	  for(j=0; j < num; j++) <br />
	  { // for each node<br />
	     double distance, angle, covrdArea;<br />
	     distance = caldist(nodes[i].lctn, nodes[j].lctn);<br />
									<br />
	     if(distance <= (2*((double)nodes[i].radius)) && distance > 0.0) <br />
	     {// the node is in transmission range<br />
	     angle = getangle(nodes[i].lctn, nodes[j].lctn, distance);<br />
	     //sector_id = nodes[i].neiglist.ngsectlist[j].sectorid;<br />
						<br />
	     covrdArea = getArea(nodes[i].id, nodes[j].id, distance, angle);<br />
						<br />
	     tw.WriteLine("Distance form Node_" + nodes[i].id + " to Neighbour Node_" + nodes[j].id + " is " + distance);<br />
	     tw.WriteLine("Angle btw Node_" + nodes[i].id + " in sect " + numsect + " to Neighbour Node_" + <br />
                              nodes[j].id + " is " + angle);<br />
	      tw.WriteLine("Neighbouring Node_" + nodes[j].id + " is covering " + covrdArea + " percent of Node_" +<br />
                              nodes[i].id + "'s sensing area");<br />
								<br />
<br />
	    }//if (distance..<br />
	  }//for (j...<br />
	tw.WriteLine("----------------- END OF NEIGHBOUR_LIST OF NODE_" + nodes[i].id +" --------------------------");<br />
	tw.WriteLine("");<br />
	nbuffer.Add(nodes[i].id);<br />
     }//for (i...<br />
     nbuffer.Clear();<br />
				<br />
     tw.Close();<br />
}//end of method getsimInfo  



Thanks

aussi
GeneralRe: Using ArrayList in C sharp Pin
Christian Graus5-Oct-04 11:48
protectorChristian Graus5-Oct-04 11:48 
GeneralDisabling a TabPage in TabControl Pin
jagan795-Oct-04 5:41
jagan795-Oct-04 5:41 
GeneralRe: Disabling a TabPage in TabControl Pin
sreejith ss nair5-Oct-04 6:03
sreejith ss nair5-Oct-04 6:03 
GeneralRe: Disabling a TabPage in TabControl Pin
jagan795-Oct-04 6:33
jagan795-Oct-04 6:33 
GeneralRe: Disabling a TabPage in TabControl Pin
Ruchi Gupta5-Oct-04 11:30
Ruchi Gupta5-Oct-04 11:30 
GeneralRe: Disabling a TabPage in TabControl Pin
jagan795-Oct-04 12:14
jagan795-Oct-04 12:14 
GeneralLibrary References Pin
Jose Vicente5-Oct-04 4:11
Jose Vicente5-Oct-04 4:11 
GeneralRe: Library References Pin
Colin Angus Mackay5-Oct-04 5:31
Colin Angus Mackay5-Oct-04 5:31 
GeneralRe: Library References Pin
Jose Vicente5-Oct-04 5:35
Jose Vicente5-Oct-04 5:35 
GeneralRe: Library References Pin
Colin Angus Mackay5-Oct-04 5:41
Colin Angus Mackay5-Oct-04 5:41 
GeneralRe: Library References Pin
Jose Vicente5-Oct-04 5:45
Jose Vicente5-Oct-04 5:45 
GeneralRe: Library References Pin
Colin Angus Mackay5-Oct-04 5:50
Colin Angus Mackay5-Oct-04 5:50 
GeneralRe: Library References Pin
Dave Kreskowiak5-Oct-04 6:30
mveDave Kreskowiak5-Oct-04 6:30 
GeneralRe: Library References Pin
Jose Vicente5-Oct-04 20:15
Jose Vicente5-Oct-04 20:15 
GeneralRe: Library References Pin
Dave Kreskowiak6-Oct-04 13:11
mveDave Kreskowiak6-Oct-04 13:11 
GeneralRe: Library References Pin
Jose Vicente6-Oct-04 21:11
Jose Vicente6-Oct-04 21:11 
GeneralP/Invoke data type conversion Pin
ting6685-Oct-04 1:51
ting6685-Oct-04 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.