lua-users home
lua-l archive

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


Hi everyone,

I am tring my first big project with Lua and I am in the design phase. I has a, what I hope to be easy, question.
How do I iterate thru the keys of a table using the C API? More specifically, I don't want to know the keys or values of a table. I just want to iterate through them and find out there "names".

Example: (In Lua)
-- This would be a function defined in C that would just make it so that I knew the table to iterate through later.
button = CreateWidget( "LoadsTheNameOfThisString" )
button.width = 40
button.length = 100
button.style = { "visible", "push_button", "border" }
button.id = -1
-- This continues and I don't want to have specific knowledge of the keys and values from inside C.

Can this be done? Can somebody give me some pointers?
--
Regards,
Ryan
RJP Computing