kevin33809
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There's no InList() in VB.Net...
ASKER
Thank you, Programmers. You both had the Best Solution, so I split the reward. I appreciate you help and quick response. Thanks again.