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.
Programming Languages-OtherVisual Basic Classic

Avatar of undefined
Last Comment
kevin33809
SOLUTION
Avatar of andygrant2005
andygrant2005
Flag of United Kingdom of Great Britain and Northern Ireland image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of vb_elmar
vb_elmar
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Mike Tomlinson
There's no InList() in VB.Net...
Avatar of kevin33809
kevin33809
Flag of United States of America image

ASKER

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

Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.

165K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo