lua-users home
lua-l archive

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



>>> andreas@airsoftsoftwair.de 08/04/04 02:46PM >>>
I can get the values of the variables using luaL_checknumber()
but is it also possible to get the names of the variables that
were passed? i.e. the strings "a", "b" and "c"

All parameters are passed by value, so you have
no way of finding out the variable names.   You could 
define your function to receive a table parameter:

   func { a = 1, b = 2, c = 3 }

and in fact this is recommended in PIL as a way to have
parameters passed 'by name'.

I assume there's something special about those values,
that you want to know the name attached to them. If they
were tables you could easily attach a name to them
using another table.

steve d.



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.