|
| 25 Aug 2012 12:55 PM |
Example: my_stupid_table = {first = {"blah", "halb"}, second = {"derp", "pred"}}
How would I get it to print halb?
print(my_stupid_table[first[2]]) or print(my_stupid_table[first][2]) ?
~This sig is false~ |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 12:56 PM |
print(my_stupid_table[first][2])
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]-
|
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 01:00 PM |
So then how would you call a function within a table within a table?
my_dumb_table = {thing1 = {name = "LOLZ", effect = function(stuff) print(stuff) end}}
would it be my_dumb_table[thing1][effect]("blah") or my_dumb_table[thing1][effect("blah")] ?
~This sig is false~ |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 01:07 PM |
Whoops, my first post was wrong. my_stupid_table["first"][2] or my_stupid_table.first[2]
And for your second question my_dumb_table["thing1"]["effect"]('hi') or my_dumb_table.thing1.effect('hi')
-[::ƧѡÎḾḠΰῩ::]-[::Maker of stuff and Helper of Scripting::]- |
|
|
| Report Abuse |
|
|