How to show many rows from table?

paralyzeparalyze Member Posts: 20
edited October 2012 in Working with GS (Mac)
Hi, Im making an search function in my app and when you type first letter, "a" for example then the app lists all the words starting on "a",

I put all the a words on the first row, so how do I make a display text function that shows all the a words in the first row(in this case all the a words up to row15, I am only able to show one word at a time for now.
I really appreciate for an answer.

this is how i have the code now

Rule, if game.text begins with a(where game text is the input from keyboard)
then
display text
tableCellValue(game.companiesTBL ,1,1)

so i want to show row 1 to 15 for example how do i do? (tableCellValue(game.table,row,col)?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I just answered this a couple weeks ago but I can't seem to find the thread. If you check my post in this thread: http://forums.gamesalad.com/discussion/41887/i-can-make-a-loop-in-the-gs you can use the loop counter attribute as your row number to look up (and display) table cell values.

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

  • paralyzeparalyze Member Posts: 20
    Thanks so much for the answer, I kinda new at this so this sound so difficult to do, I tried to do the loop, I can se the text changing to another row, but its still one at a time.
    Have you any easier way to do this?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited October 2012
    You would need 15 actors each with a DisplayText behavior to display 15 table cells. And in that case, I guess you don't really need a loop at all. A loop is only useful if you're using a single actor (e.g. display row 1, wait 5 seconds, display row 2, wait 5 seconds, etc.).

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited October 2012
    This has come up often enough that I decided to make a demo. This solution only works for short tables (e.g. 10 rows or less), but I was able to display two table columns using two actors with a single loop.

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

  • paralyzeparalyze Member Posts: 20
    Thanks the demo! I tried to put in many words in the same rowframe by pressing alt+enter and now I can show many rows of text of for example all "a" words just by calling celltablevalue.

    Thanks for the file I look at it and try to find the best for my app.
    Cheers!
  • UtopianGamesUtopianGames Member Posts: 5,692
    This free template might also help.

    http://www.deepblueapps.com/collisions-with-tables-template/

    Darren.
Sign In or Register to comment.