The help file says you can do this:
but what if my index is in a variable? Like this:
Is there a way to use that variable to access the appropriate table element?
Possibly like these?
Thanks!
Code:
food{}; food.veggie = "Carrot"; food.fruit = "Apple"; drink = food.fruit.." cider";
Code:
foodtype = "fruit";
Possibly like these?
Code:
drink1 = food.foodtype.." cider"; drink2 = food[foodtype].." cider";
Comment