Reputation: 934
A section of code I was updating used a select case statement to compare the value of a string...
I noticed that for two possible values, I could end up re-using the same bit of code.
So I added a case:
Case "Yes/No" Or "Continue"
However, when I reached this point, I'd throw an invalid cast exception.
The exception said it was trying to cast "Yes/No" as a Long value instead of a string.
Taking 'Or "Continue" ' and moving it to it's own case statement with a duplicated section of code resolved the issue.
I'm trying to find out why "Yes/No" Or "Continue" didn't work out the way I'd expected.
I was under the impression that I could write out an expression there similar to the way I could when writing an If statement.
Upvotes: 1
Views: 656