lua:lua
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| lua:lua [2011/06/30 10:57] – deva | lua:lua [2012/04/20 13:53] (current) – deva | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| // and then some code to bind it to " | // and then some code to bind it to " | ||
| + | </ | ||
| + | |||
| + | ===Array of arrays=== | ||
| + | An array with 10 entries each containing 2 entries: | ||
| + | < | ||
| + | int num = 10; | ||
| + | int sz = 2; | ||
| + | | ||
| + | lua_createtable(L, | ||
| + | int toptop = lua_gettop(L); | ||
| + | |||
| + | for(int i = 1; i <= num; i++) { | ||
| + | lua_createtable(L, | ||
| + | int top = lua_gettop(L); | ||
| + | |||
| + | for(int j = 1; j <= sz; j++) { | ||
| + | char buf[10]; | ||
| + | sprintf(buf, | ||
| + | lua_pushstring(L, | ||
| + | lua_rawseti(L, | ||
| + | } | ||
| + | |||
| + | lua_rawseti(L, | ||
| + | } | ||
| + | |||
| + | return 1; | ||
| </ | </ | ||
lua/lua.1309424233.txt.gz · Last modified: by deva
