lua-users home
lua-l archive

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



It's not entirely clear what you want to do. You can create new global
variables via _G. But why would you want to create local ones that way,
why not simply use a table? I'd be interested to hear the use case.

Also, I think you meant to write "for i = 10, 1, -1 do".

Robby

Hi Robby

Thanks, yes "for i = 10, 1, -1 do".

I wanted to generate a bunch of "free standing tables within a namespace but not nested in another table. Each table would be a manufacturers part number and would start with letters and end with numbers, i.e WOT2930, hence the concatenation.



I bet I'll just end up doing this with nested tables or Globals but I was also trying to come up with a a DIY data structure in C. I was thinking that is I had 2 or more arrays in C within a function I could insert a key in one and a value in another and still reference both by their numeric keys. I am trying to build a constructor prototype for use in both C and Lua.

I might also try to generate a child Lua script by writing this to a file instead.

Thanks again-Patrick