It seems you haven’t quite understood Tom’s speakings. He’s referring to the fact that, should the variables not have a unique address identifier doohickey (e.g. your variables are not tables, userdatas, functions, and baby rabbits or zebras as well as most other types of animals), your code will not tell if it cometh from the table.
Besides, this is probably faster than your attempt (dunno… is Corona’s indexOf function written in C++ or Lua?):
if table.indexOf(mytable, somethingelse) then print("Hippety hop!") end
The basic issue here is that you can just as easily tell Lua to check for a plain raw number (not the element from the table):
if table.indexOf(mytable, 5) then print("Hippety hop!") end
Or a string:
if table.indexOf(mytable, "padded sofa") then print("Hippety hop!") end
Or a Boolean:
if table.indexOf(mytable, true) then print("Hippety hop!") end
And there’s no way to know if the particular thing you checked for came from the table or is just a doppelganger posing as something from the table so that it can take over the country. There is no “Hi, I’m 5 and I’m from the table” vs. “Hi, I’m 5 and I’m just a boring other-thing”. Your approach works only half of the time. Which is, I suppose, better than none, but Tom, being a forum moderator and Corona guy, wanted to give myleggguy721 an approach that works for everything, and, because of the fundamentals of Lua itself, this is simply not possible. (Cue the goat going “Bleeeeh!” and the tuba)
Plus, Tom was very polite and you weren’t quite so polite… I believe most people here are just trying to help. 'Course, if you didn’t mean to be impolite, by all means say. It came across that way.
Violets and all that jazz,
~ Idyllic
P.S. If you have a daughter you should watch The Little Mermaid with her sometime. If you have a son, The Lion King. If you have neither, give it up and go watch LOTR or Star Wars by yourself. All good movies. Personally, I like the Star Wars movies better than LOTR. What about you?