Modify value in array passed to function not working

If I have a function that gets a parameter of an array, how do I modify a value in it, then pass it to transition.to?
I know how to do it, but it’s not working. What am I doing wrong? Here’s my non-working code:
[lua]function moveGround(ground,p1)
p1[onComplete] = function() moveGround(ground,p1) end
–do other stuff
tmove = transition.to(ground,p1)
end

moveGround(groundObj,{x=100,y=235})[/lua]
I get a “table index is nil” error. Help anyone? [import]uid: 8782 topic_id: 5686 reply_id: 305686[/import]

2 ways to index a table
(1) table[“key”] = value or table[20] = value – 20 is the key
syntactic sugar:
(2) table.key = value [import]uid: 12635 topic_id: 5686 reply_id: 19483[/import]

Thanks, EdwardK! How did I forget to put onComplete into quotes… tisk tisk tisk to me. [import]uid: 8782 topic_id: 5686 reply_id: 19491[/import]