Assigning a variable as the table name.

kanuvaskanuvas Member Posts: 21
edited June 2012 in Working with GS (Mac)
Hi All,

Is it possible to use a variable as a table name?

For example I have 5 tables (Table1, Table2, Table3, Table4 and Table5)

I have a variable called RANDOMTABLE which produces a text value of (Table1, Table2, Table3, Table4 or Table5)

Now what I want is this:

Set self.MyValue to: tableCellValue(RANDOMTABLE, 1,1)

So in theory (though it doesnt work which is why i need help) this should be read by GameSalad if RANDOMTABLE is Table2 as:

Set self.MyValue to: tableCellValue(Table2, 1,1)
(This then sets MyValue to whatever is in 1,1 on Table2

--------
The reason I need this is I have 6 Tables each with lots of data in them. The buttons the user presses throughout the application assign variables to values to draw out specific bits of information from the tables. This requires a vast amount of if statments to be used unless I can use a variable as the table name.

Any help would be appreicated.

Cheers

S

Answers

  • kanuvaskanuvas Member Posts: 21
    Damn! I knew someone was going to say that :((

    Thanks for letting me know.

    S
  • KiwiLeeKiwiLee Member Posts: 181
    Try assigning the data to columns 1,2,3 for table one and 4,5,6 etc for table two and then use an offset to determine which table. might help! If you have varying amounts if data in tables then you may need to consider prepopulating with x rows of blanks so you can do change cells!
Sign In or Register to comment.