L
-Lost
Response to "Peter Duniho said:I was currently doing this:
scores.GetType().ToString() == typeof(String).FullName
So, it works to the extent that it will not allow me to declare
an instance of my custom class and pass string arguments to the
constructor.
I don't understand how this relates to your question. The code
you posted validates the argument as being a string (sort
of...to do that, you should actually use "scores is string"
rather than comparing the type names), not as being numeric.
If for example I was doing this:
myAverageClass average = new myAverageClass(100, "90", 80);
I wanted to be able to catch that. However, it disallowed me
being able to pass arguments via the command-line (as they were
all caught by it).
I still don't understand. You want to be able to catch what?
That a string was passed into it (yet I've come to realize that was
not the problem, the problem was no input that did not represent
numeric input).
What disallowed you being able to pass arguments via the
command-line?
The way I was originally checking if the argument was a string (at
the top of this post).
And what does constructing a new instance of "myAverageClass"
have to do with the command-line arguments?
It doesn't. I was referring to the way I was checking for strings
above. I couldn't pass anything via the command-line because
everything is a string from the command-line.
All in all, I'm probably just explaining everything very poorly. I
hope I cleared it up.
Thanks, Pete.