Table query question: Check if a string exists in a table

I want to check if a string entered by a player exists in a table as an if condition in a rule. I've poked at it a bit but can't seem to quite get it to work right. Is there a way I can basically get a bool returned from a table search?

Answers

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Use the tableSearch function to search the table for the String. I have a few tableSearch demos on the forums and GSHelper.com

  • d.c.enrightd.c.enright Member Posts: 2

    I have a tableSearch set up to search for the string (which is stored in an attribute) but I'm not sure what the tableSearch is returning, whether it finds it or not. Basically I need to check if a string is NOT in a table as a rule condition.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Start with this one, if you haven't yet:

    http://forums.gamesalad.com/discussion/comment/452312/#Comment_452312

    The tableSearch function returns the row or column number where the key is found or 0 if no key is found.

Sign In or Register to comment.