This definitely not exactly what you are looking for, but it should get you
on the right path.
private void BuildArrayList()
{
arraylist myArray = new arraylist();
// code to read in your data
while(data.read())
{
try
{
// the data I am adding is just some arbitary junk
// you will have to put in the info you want
myArray.Add(data(0));
}
catch (exception ex)
{
// this will load any items that are "automated"
// by catching the exception thrown and adding
// a handled item in the list
myArray.Add("Exception Item");
}
}
}
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
keys4worship <st*****@gmail.com> wrote: I am populating an arraylist from a text file on my PC. I am using this
information with C# to perform actions against a PCOM session. A for
loop handles the actions to perform. If for some reason the action
fails using one of the items in the arraylist the loop continues until
the last item in the arraylist is reached.
What I need to do is somehow annotate those items that were
successfully automated so that any items that excepted could be handled
manually.
What is the best way of handling this?
Write back to the array with a success indicator?
Write unsuccessful items to another outputfile?
???
I'd create another ArrayList, and when you hit an unsuccessful item,
add it to that ArrayList. Depending on your situation, you may of
course need to persist that to a file.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too