I have an ArrayList of objects. This is sort of a quick and dirty thing, so the objects are not a class, just defined by a statement like
struct mp3
{
public string FileNm;
public int RecNum ;
...
}
My question is can I access the individual elements of the object using an index rather that name?
For example, instead of ArrayList1[44].FileNm I want to use ArrayList1[44][0] or something like that.
This is so I can use a loop to quickly go through all elements of the struct.
Loading
VulpesPosted Mar 26, 2012, 3:57 PM
Here's a simple example I've just thrown together:
If list were an ArrayList instead, then you'd need to cast to mp3 before you could apply the indexer which makes the code rather ugly:
Michael CortPosted Mar 26, 2012, 3:41 PM
VulpesPosted Mar 26, 2012, 3:37 PM