I’m used to Javascript and the ability to create arrays and objects like so:
var bar = [];
var currentBeats;
bar[1] = {beats:4, subdivisions:2};
bar[2] = {beats:2, subdivisions:2};
bar[3] = {beats:3, subdivisions:2};
--Access or set an index
currentBeats = bar[3].beats --returns 3
Sorry for the simplicity of this, but I’m a bit stuck: how do you pull this off in Lua? I’ve attempted this to no success:
local bar = {}
table.insert(bar["beats"], 4)
table.insert(bar["beats"], 2)
table.insert(bar["beats"], 3)
thx for any help,
hdez
[import]uid: 7947 topic_id: 1777 reply_id: 301777[/import]