Posted 03 April 2014 - 08:53 PM
So I'm working on learning lua. So much reading but gonna be worth it especially since I'm learning it not just for Minecraft but for possible apps and such. After I learn this I'm gonna move onto java or C. However I came across a few different types of table modifications. So if I have…
Wire = {}
Wire.Red = "redWire"
or
Wire[Red] = "redWire"
What is it that doesn't let me call either or? I'm sure the answer is obvious but if I have a table and I'd want to use the wire.Red to make a modification or to add or remove but I'd like to call them with the brackets why can't I do that? Sorry in advance trying to learn everything.
I think I literally just figure it out that Wire["Red"] is the same as Wire.Red I guess it's so that you can use the same variable with a bit different output or something?
Wire = {}
Wire.Red = "redWire"
or
Wire[Red] = "redWire"
What is it that doesn't let me call either or? I'm sure the answer is obvious but if I have a table and I'd want to use the wire.Red to make a modification or to add or remove but I'd like to call them with the brackets why can't I do that? Sorry in advance trying to learn everything.
So I'm working on learning lua. So much reading but gonna be worth it especially since I'm learning it not just for Minecraft but for possible apps and such. After I learn this I'm gonna move onto java or C. However I came across a few different types of table modifications. So if I have… Wire = {} Wire.Red = "redWire" or Wire[Red] = "redWire" What is it that doesn't let me call either or? I'm sure the answer is obvious but if I have a table and I'd want to use the wire.Red to make a modification or to add or remove but I'd like to call them with the brackets why can't I do that? Sorry in advance trying to learn everything.
I think I literally just figure it out that Wire["Red"] is the same as Wire.Red I guess it's so that you can use the same variable with a bit different output or something?