troubleshooting Question

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

Avatar of kevin33809
kevin33809Flag for United States of America asked on
Programming Languages-OtherVisual Basic Classic
4 Comments2 Solutions1419 ViewsLast Modified:
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.
ASKER CERTIFIED SOLUTION
vb_elmar

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros