An array in Lua is called a Table. The syntax is different, but the principal is the same.
Note that [tt]luup.variable_set(…)[/tt] needs a String, not a Table, so you’ll need to write code to convert back-n-forth (serialize/deserialize) between the Table form and the String form when using Vera/Luup for persistence.
You’ll want to break the problem up into smaller pieces that you can experiment with, and then piece back together.
The key pieces are:
a) A function that takes a Table parameter, and returns a String.
The key Lua functions here are [tt]pairs()[/tt] and the string concatenation operation “[tt]…[/tt]”
To test this, you can pass in a table value like:
[tt] local testTableData = {“first value”, “second value”, “third value”}[/tt]
b) A function that takes a String parameter, parses it, and returns a Table.
The key Lua functions here are [tt]string.match[/tt], or maybe [tt]string.gmatch[/tt]
To test this, you can pass in a string value like:
[tt] local testStringData = “first value, second value, third value”[/tt]
Once you have those, you’ll be set. There’s TONs of code on http://code.mios.com that does this stuff, you’ll need to roll up your sleeves to experiment with it.
Develop the above components using the command line Lua, it’ll save you all the restarts that you’d have to develop it under Vera. Command line Lua’s are available for All platforms… and Google will help you find examples of ALL of this as well.