tags:

views:

21

answers:

1

Still having trouble can you please help?

This needs to be written in Visual Basic

Here is a statement from the Main part of the program...

mylist.ForEach(AddressOf ProcessLink)

What this statement says is the following.... "For each item in the ArrayList "mylist" send item to the sub program "ProcessLink"

Note that ProcessLink is going to receive multiple groups of data from the ArraList "mylist"

ProcessLink then takes each value sent to it and turns it into "P.myName" and P.myValue"

I need ProcessLink to then add these values to an array. And each time it receives a batch of data from the ArrayList "mylist" it will add those values to the same Array. ProcessLink will then sort the array based on "P.Value"

I then need ProcessLink to output the name value pairs in the array and output the result as...

Response.Write("<tr><td>" & P.myName & "</td><td>" & P.myValue & "</td></tr>") 

What should the code in ProcessLink look like?

A: 

I really reccomend using generic object lists rather than Arrays. You will get all of the functionality you need + 10x more. Sorting, adding, etc are way easier. With generic lists you don't have to worry about declaring the Array size, or any of the difficulties when working with Arrays containing objects. Take a look to the following for more information including the code sample:

.NET Object Collections Using Generics 101:

http://allen-conway-dotnet.blogspot.com/2009/11/net-object-collections-using-generics.html

List(Of T) Class:

http://msdn.microsoft.com/en-us/library/6sh2ey19.aspx

atconway