Generally variables that refer to objects can have customer attributes, where as primitives cannot, so if your variables are not primitives, you can set custom attributes as so,
local Group = display.newGroup()
Group.myName = "Group"
.
.
object = event.Target
print(object.myName)
.
.
If this was a primitive, like a number of a string, you would get an error that states that you are trying to index it.
If using primitives is very important to you, then create tables for each variable that way you can tag it with whatever custom data you want. I am unsure of the overheads of this approach.
However, if anyone knows how to use referenceByString type of approach in Lua, what I am after is
theName = "Jayant C Varma"
myVariable = "theName"
print (referenceByString(myVariable)) --- should print Jayant C Varma
and as in Objective-C where you can call a selector by name, so
myFunction = "moveLeft"
callFunctionByName(myFunction)
cheers,
Jayant C Varma [import]uid: 3826 topic_id: 3493 reply_id: 11173[/import]