Avatar of kevin33809
kevin33809
Flag 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.
Programming Languages-OtherVisual Basic Classic

Avatar of undefined
Last Comment
kevin33809

8/22/2022 - Mon
SOLUTION
andygrant2005

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
vb_elmar

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Mike Tomlinson

There's no InList() in VB.Net...
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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck