How can I rearrange a table after remove a row?

3MDN33MDN3 Member Posts: 15
edited April 2015 in Working with GS (Mac)

Hi, I have a removing row problem in my project.
Every row contains its table value as its row number in order. (If it's row 1, column1, its table value is 1 and if it's row 2, the table value is 2)
But if I remove a row, the table value is not matched with its row number.
So, I want to give -1 to table values which doesn't match with row number, but I don't know how to change table values of specific part of the table.
(If I remove the row, under it has correct values and just above it has not matched values, right?)
How can I change table values to match them with row numbers?
Please, help me.

Comments

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

    Are you saying that if you remove the 4th row from a table that looks like this...

    1
    2
    3
    4
    5

    ...you want it to look like this...

    1
    2
    3
    4

    ...instead of this...

    1
    2
    3
    5

    ...?

    How are you using the table values? I'm wondering if a single integer attribute might achieve the same thing.

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

  • ArmellineArmelline Member, PRO Posts: 5,369

    I assume there are things in the other columns of the table? Otherwise I'm not sure what the point of removing a row would be in these circumstances.

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    Are you saying that if you remove the 4th row from a table that looks like this...

    1
    2
    3
    4
    5

    ...you want it to look like this...

    ..................

    Yes, that's exactly what I want.
    I'm going to make bookmark. In a scene, there's 5 actors and 1 actors for bookmarking.
    When I click actor 1 and then click bookmark, table value of table 1 goes to table value of table 2.
    So, If I clicked actor 1,3,5, in table 2 there's 3 rows.
    But I have trouble with unchecking bookmark. If I remove bookmark of actor 3, there's 1 and 5's value is left. Cause row 3 of table 2 moves to row 2, I have problem with removing row.
    If I change the integer attribute (game.bookmark numb) that set to remove rows to game.bookmark~ -1, I can't remove table 2's row 1, while I don't change the attribute, I have trouble with removing table 2's row 2.
    Therefore my idea is that make table 3 and save game.bookmark numb to tablevalue(table 3, actor number, 2). So if I click actor 1, 3, 5 in order, in table 3

    1 1
    2
    3 2
    4
    5 3

    and if I uncheck actor 3, I want to make table 3 like this

    1 1
    2
    3
    4
    5 2

    then I can remove row by using table cell value(table 3, actor number, 2)

    I'm very sorry that you have to read my poor english and interpret it, but I need your help eagerly... please help me.

  • 3MDN33MDN3 Member Posts: 15

    @Armelline said:
    I assume there are things in the other columns of the table? Otherwise I'm not sure what the point of removing a row would be in these circumstances.

    Thanks for comment. I explained (maybe it's not easy to understand cause I'm not from country that use english as mother tongue) it in above comment. Can you help me please?

  • ArmellineArmelline Member, PRO Posts: 5,369

    Perhaps instead just add a row to a table when you click, noting the number of the actor you clicked. So if you clicked 1,3,5 your table would be:

    1
    3
    5

    I'm still not entirely clear on why you need the two columns.

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

    What you're describing is essentially a push/pop stack:

    I can probably make a demo a bit later.

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

  • 3MDN33MDN3 Member Posts: 15

    @Armelline said:
    Perhaps instead just add a row to a table when you click, noting the number of the actor you clicked. So if you clicked 1,3,5 your table would be:

    1
    3
    5

    I'm still not entirely clear on why you need the two columns.

    i'm a new of gamesalad.. so my logic can be alot different from you.. anyway thank you for help me!!!!

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    What you're describing is essentially a push/pop stack:

    I can probably make a demo a bit later.

    I think that push/pop thing is just what I expected... i don't know how to appreciate you... i will wait for your great demo!!! thanks alot again...!!

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

    Are you using a Mac or PC? I have an idea for how to do this using text string functions such as TextSubStr() but I don't know if the PC version of Creator has them.

    Also, are you storing other data in the table or just the bookmark integer value?

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

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

    Here's a demo made in Mac Creator 13.7. If you are using a PC, Google convert mac to windows gamesalad for instructions on how to open it in Windows.

    Click on a number to add it as a bookmark. Click again to remove it.

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

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    Are you using a Mac or PC? I have an idea for how to do this using text string functions such as TextSubStr() but I don't know if the PC version of Creator has them.

    Also, are you storing other data in the table or just the bookmark integer value?

    i can use both. thank you a lot! there's no other data in the table. Again, thank you very much.

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

    I just replaced the attached file with an updated version where you can click on a bookmark number to add or remove it from the list.

    You're welcome.

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

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    I just replaced the attached file with an updated version where you can click on a bookmark number to add or remove it from the list.

    You're welcome.

    I know it's shame to ask you more question.. but I have a trouble.
    I thought I could apply your demo to my project… but I can't make it.
    How can I apply push/pop stack to table row? I mean, If I press actor 1,3,5, save their values from original table to bookmarking table by using add/remove row. (Just like push/pop stack you made, add and remove row of bookmarking table.)
    Can you help me please one more time????

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

    You said there was no other data in the table so I guess I'm confused now about what you're trying to do. My demo didn't use tables at all.

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

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    You said there was no other data in the table so I guess I'm confused now about what you're trying to do. My demo didn't use tables at all.

    i'm sorry about that. when i wrote that comment, i didn't check the demo... i don't know why then i thought i got the answer just i wanted without checking it..and i thoguht you mentioned 'the other data' cause i explained the table has 2 columns... it's definitely my fault..
    what I tried to do was transferring values from one table to the other with push/pop stack...
    i'm really sorry that i made you confused and i tried to solve the problem by my self cause i made serious mistake on posting comment without checking demo... but i reallized i have no talent to solve it... i'm really sorry

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

    Maybe you can step back and explain more about what you're trying to do. The word "bookmark" could mean many things. Is this an actual eBook you're building? Something completely different? Why do you have multiple tables? Why not just use a single table?

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

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    Maybe you can step back and explain more about what you're trying to do. The word "bookmark" could mean many things. Is this an actual eBook you're building? Something completely different? Why do you have multiple tables? Why not just use a single table?

    I'm making a word quiz application.

    postfiles10.naver.net/20150501_25/3mdn3_1430433477972ehX6a_PNG/gamesalad.png?type=w2

    Like this. I want to make a bookmark to select words which I want to study later.
    I need 2 table, one is original table which contains words and the other is bookmarked table which saves checked words.

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

    Unfortunately, I can't view that image:

    You don't have permission to access "http://postfiles10.naver.net/20150501_25/3mdn3_1430433477972ehX6a_PNG/gamesalad.png?" on this server.

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

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

    Okay so clicking the star would bookmark that particular word and add it to the list of bookmarks?

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

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

    I guess you'd need an actual table-based push/pop system then. I find that to be a bit of a pain because of having to shift rows. It's sometimes better to just toggle a table value such as a boolean to designate that row as bookmarked. Then the hard part is displaying only those rows with that boolean value true. A Loop over Table behavior could be useful for "constructing" the list of rows to display. Not the easiest thing but hopefully that offers you some insight!

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

  • 3MDN33MDN3 Member Posts: 15

    @tatiang said:
    I guess you'd need an actual table-based push/pop system then. I find that to be a bit of a pain because of having to shift rows. It's sometimes better to just toggle a table value such as a boolean to designate that row as bookmarked. Then the hard part is displaying only those rows with that boolean value true. A Loop over Table behavior could be useful for "constructing" the list of rows to display. Not the easiest thing but hopefully that offers you some insight!

    thanks, i'll try with your help! but can you explain about loop over table behavior?? it's one of the behaviors that i can't understand what they do and how do work. I've been tried to find it with google searching, cookbook, youtube but i can't find it clearly..

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

    Here's a brief explanation:

    And attached is a really basic demo.

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

Sign In or Register to comment.