Read the
Lua Basics section from
this post, and consider clicking through the introduction section of the
lua manual, because if you don't understand how a variable gets passed to a function then you are going to be in for a bad time trying to program an addon.