Use a String-list rather than multiple "OR" statements
The question I have is if I can make an arbitrary string list:
- ZOO={"cat", "dog", "bird"}
And reference that against a database:
- For each row in DATABASE [ZOO.contains(animal)]
- {
- //some code
- }
...would return true if the animal column is cat, dog or bird. I cannot figure out how to do this, or if it's even possible. The only way I know how to do this is using lots of OR's, and it looks inefficient:
- for each r in DATABASE [((animal == "cat" || animal == "dog") || animal == "bird")]
- {
- //some code
- }
Thanks
John M. Whitney
