Link to home
Start Free TrialLog in
Avatar of kevin33809
kevin33809Flag for United States of America

asked on

How do I check a list of numbers in VB6 if there is no INLIST function.

Hello

In VB.Net there is a function -- INLIST(), where I can put a list of numbers and check against what is in a variable.  Could someone show me in VB6 code how to check a list a numbers/chars against a given variable, that will function the same way as a InList function does?  Thanks.

Example:

if CoPlanID = INLIST(1, 10, 15, 20, 23, 50, 150) then
     var = "found it"
else
     var = "did not find it"
end if

......I need replace code for what I use the INLIST function for.
SOLUTION
Avatar of andygrant2005
andygrant2005
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Tomlinson
There's no InList() in VB.Net...
Avatar of kevin33809

ASKER

Thank you, Programmers.  You both had the Best Solution, so I split the reward.  I appreciate you help and quick response.  Thanks again.