Resolved problem with select case

andyvl

Member
Joined
May 14, 2009
Messages
14
Programming Experience
Beginner
Select Case toCheck
Case toCheck.ToUpper.StartsWith("OPERATIONS INDIA")
actionIndia()
Case toCheck.ToUpper.StartsWith("OPERATIONS FRANCE")
actionFrance()
End Select

is not working. it doesn't do anything althoug a watch on
toCheck.ToUpper.StartsWith("OPERATIONS INDIA")

is listed as TRUE


what am I overlooking in my code?
 
Last edited:
That's because you're checking a string (toCheck) against booleans. You need to change it to check a boolean against boolean cases:
VB.NET:
Select Case True
    Case toCheck.ToUpper.StartsWith("OPERATIONS INDIA")
        actionIndia()
    Case toCheck.ToUpper.StartsWith("OPERATIONS FRANCE")
        actionFrance()
End Select
 
Back
Top