I am passing an ArrayList successfully from my boundary class to the control class. I need to error handle the data so I created an ErrorHanlder that would handle the Regex.
How do I pull the elements of the ArrayList out and run Regex on them?
Thank you for your time
Steve![]()
-
-
huh?
try
{
...
}
catch (Exception e)
{
foreach (String s in YourArrayList)
{
RegEx.Match(s, blah)
}
}
Something like that. Assuming you have Strings in your array list. -
[H]I have some strings in the ArrayList. Most of the data is a combination of DateTime and doubles as well as decimals.
Was the Huh? about the boundary controller stuff?
Steve -
DesignMail wrote:[H]I have some strings in the ArrayList. Most of the data is a combination of DateTime and doubles as well as decimals.
Was the Huh? about the boundary controller stuff?
Steve
well some of your first post was not really clear.
also it sounds like an ArrayList and your data are not really a good design....
why does the list contain different "Types of" data ??
if you have no other options then you are going to have to do some work to make it work...
for example :
look up the Type methods in .net for how to find the "type" of an object and then based on the type determine what to do.
for example a
switch(){
case : {}
}
where the switch is on the Type and each case handles a type
for some you use the RegEx and for other do what ever...
but most of the time an ArrayList is not the way to go unless you have no options.
-
I have since found the needed code and the ArrayList design flaw you mentioned has been abandoned. I have since used a try catch that could account for most of the trouble that I was having. I only have to account for a single string (clientName).
Thank you for your response.
Thank you for your time
Steve -
Thanks Josh I have seen fixed the trouble and only have a single string (clientName) to work with.
Thank you for your time
Steve[H] -
DesignMail wrote: so I created an ErrorHanlder that would handle the Regex

I wasn't sure what the error handler was actually trying to catch. That's all. Glad to hear you got it worked out.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.