Maybe "in" doesn't do quite what I think it does.
I'm trying to set a variable based on the value of another variable. If the value of the first variable is in a specified list, then the value of the second variable should be set.
For instance, lets say
userinput = "apple"
if userinput in ("carrot", "celery", "tomato"
then
type = "vegetable"
elseif userinput in ("apple", "peach", "pear"
then
type = "fruit"
end if
That's the basic concept, but I haven't gotten it to work quite like that. I think I've been working with PHP too much.
Unfortunately, when searching for something like "in", you don't get too much help from search engines, if they even decide allow "in" as a keyword. But there's no doubt another asp-specific way to do this, I just don't know what it is.
The alternative is to have each of those specified values in an array, and loop through them to check each against the userinput. That seems like a roundabout way of doing it, but if that's what I have to resort to, then I guess I shall.
Anyone?
I'm trying to set a variable based on the value of another variable. If the value of the first variable is in a specified list, then the value of the second variable should be set.
For instance, lets say
userinput = "apple"
if userinput in ("carrot", "celery", "tomato"
type = "vegetable"
elseif userinput in ("apple", "peach", "pear"
type = "fruit"
end if
That's the basic concept, but I haven't gotten it to work quite like that. I think I've been working with PHP too much.
Unfortunately, when searching for something like "in", you don't get too much help from search engines, if they even decide allow "in" as a keyword. But there's no doubt another asp-specific way to do this, I just don't know what it is.
The alternative is to have each of those specified values in an array, and loop through them to check each against the userinput. That seems like a roundabout way of doing it, but if that's what I have to resort to, then I guess I shall.
Anyone?