lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Max Rheiner wrote:
> 
> i'm a newbi and i try to figure it out how i can
> get the variable name of a value on the stack.

You can't ;-)  As you say, it's just a value.  What's the
name of 5 or "foo" or {}?  You could of course try to search
for that value in the global table (holds the global variables).
But the value could be in a lot of variables or in none.

If you really want a name, pass this name to your function and
let the function get the value from the global table.

Ciao, ET.