Your use of the error variable is reversed. You want to change its value when a match is found. A better name for the variable would be matchFound.
Then at the end of the loop the code can test...
Type: Posts; User: Norm
Your use of the error variable is reversed. You want to change its value when a match is found. A better name for the variable would be matchFound.
Then at the end of the loop the code can test...
Have you solved the problem?
Please edit your post and wrap your code with code tags:
<YOUR CODE HERE>
to get highlighting and preserve formatting.
Post the code that shows what you did.
The posted code throws the exception on the first non-match.
A better way would be to only throw the exception after all of the items in the list had been examined and no match had been found. Use...