GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

locate row using 2 cell values

abuabed84abuabed84 Posts: 507Member, PRO

i need a function to identify the row number using the x and y values in this table

Comments

  • abuabed84abuabed84 Posts: 507Member, PRO

    i also need to avoid any errors if the x and y values aren't in the table

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

    I would use a Loop over Table for column 1 and then a rule that says

    When tableCellValue(table,self.index,1)=[target X value] AND tableCellValue(table,self.index,2)=[target Y value]
         Change Attribute self.foundInRow to self.index

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • abuabed84abuabed84 Posts: 507Member, PRO

    Is it possible to use tableSearch in this case?
    I really want to know how the tableSearch function works

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

    Sure... the problem with tableSearch is that it only finds the FIRST matching result. So you'll still need a loop. :(

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.