Passing multiple table values to function

Hello -
Can you please point me in the right direction in regards to answering the following:

How would I pass the multiple values in a table to a function?

For example, I have function testFunction(a, b, c, d, e)

I have several tables with different values for a, b, c, d, e.

How would I pass the values in one of those table to the function?

Thank you for your help.

1
2
3
4
5
6
7
8
9
10
11
local function testFunction(valueTable)
 
 print(valueTable.a, valueTable.b, valueTable.c, valueTable.d, valueTable.e)
 
end
 
local table1 = {a=1, b=2, c=3, d=4, e=5}
local table2 = {a="A", b="B", c="C", d="D", e="E"}
 
testFunction(table1)
testFunction(table2)

Thank you very much, jmp909!

views:1189 update:2011/10/6 9:28:12
corona forums © 2003-2011