M
MikeY
Hi Everyone,
I'm am trying to find the best method option for searching through an
ArrayList and getting various items at a time. It could be 0 to 14, 15 to 25
etc,etc. I wish .GetRange(0,45) would give more options than just zero base
to whatever.
Right now, (unless there is a better option) I will keep calling the
ArrayList at various times getting the 15 or less items at a time and put
the items into another ArrayList for my usage. Is looping the best method?
Any and all help is appreciated. A sample code is at follows
private void Get_ArrayList()
{
ArrayList_Load_Data myArrayList_Load_Data = new ArrayList_Load_Data();
myArrayList = myArrayList_Load_Data.Test;
ArrayList myArrayList2 = new ArrayList();
foreach(DataItem myItem in myArrayList)
{
if(myItem.Index >= 0 && myItem.Index < 14)
{
myArrayList2.Add(myItem);
}
}
foreach(DataItem myItem1 in myArrayList2)
{
MessageBox.Show(": " + myItem1.Name + myItem1.Index);
}
}.
I'm am trying to find the best method option for searching through an
ArrayList and getting various items at a time. It could be 0 to 14, 15 to 25
etc,etc. I wish .GetRange(0,45) would give more options than just zero base
to whatever.
Right now, (unless there is a better option) I will keep calling the
ArrayList at various times getting the 15 or less items at a time and put
the items into another ArrayList for my usage. Is looping the best method?
Any and all help is appreciated. A sample code is at follows
private void Get_ArrayList()
{
ArrayList_Load_Data myArrayList_Load_Data = new ArrayList_Load_Data();
myArrayList = myArrayList_Load_Data.Test;
ArrayList myArrayList2 = new ArrayList();
foreach(DataItem myItem in myArrayList)
{
if(myItem.Index >= 0 && myItem.Index < 14)
{
myArrayList2.Add(myItem);
}
}
foreach(DataItem myItem1 in myArrayList2)
{
MessageBox.Show(": " + myItem1.Name + myItem1.Index);
}
}.