That other answer is a c# programmer masquerading as a vb
programmer ;-)
Look at using Select Case statement, something like:
Select Case lInput
Case 2,22,...
'statements
Else
'statements
End Case
Hope that helps
Mark
On Oct 14, 6:53 pm, Phil <[email protected]> wrote:
> Hopefully a simply question on vb.net syntax.
> I have a variable, lets call it iInput, which is an integer.
> If iInput is one of several values, for example 2,22,66,97,105 or 190
> then I have to do something.
>
> Is there a simple way to do this check?
>
> I seem to remember from VB that there's somethng like
> If iInput in [2,22,66,97,105,190] or maybe using () instead.
>
> I'm trying to find a more elegant way to do this than
>
> If iInput = 2 or iInput = 22 or iInput = 66 .... then
>
> Is there a neat way to do this?
>
> Thanks
>
> Phil.