Example in Clarion:
IF INLIST(MyField, "Male", "Female", "Both") MESSAGE("Valid")ELSE MESSAGE("INVALID")END
In Clarion I could test for multiple values with a single statement as shown above (I believe up to 25 values at a time). Is there a similar statement in VB.NET? Currently I have code like:
IF MyField <> "Male" AND MyField <> "Female" AND MyField <> "Both"...END
Thank you for any ideas!
Ben
Dim lcItem As String
Sorry for the newbie questions!
Either case will work. Steve's example is also a very good idea as well if you don't need to do any internal processing. The only problem with using the IndexOf may be case-sensitivity. Otherwise it is definitely the quickest route.