Author |
blah |
Pope Fleet Admiral
Joined: June 11, 2002 Posts: 2449 From: World of tomorrow
| Posted: 2003-05-11 11:40  
sucks when you cant express yourself.
im looking for a better way to numerically, sequentially iterate through elements of tables then table.foreach when the table has a) non-numerical keys and/or b) non-sequential keys
_________________
Cum catapultae proscriptae erunt tum soli proscript catapultas habebunt.
[ This Message was edited by: sono on 2003-05-11 12:03 ]
_________________
|
Chromix Cadet
Joined: June 29, 2001 Posts: 3052
| Posted: 2003-05-11 12:21  
You have: getn, foreach and foreachi.
But your original question (before the edit) gave me a nice idea for a new tutorial excercise
_________________
|
Pope Fleet Admiral
Joined: June 11, 2002 Posts: 2449 From: World of tomorrow
| Posted: 2003-05-11 13:21  
so there is really no alternative way to address table elements sequentially? BAH i say
_________________
|
Pope Fleet Admiral
Joined: June 11, 2002 Posts: 2449 From: World of tomorrow
| Posted: 2003-05-11 13:23  
Lua 5.0 was released on 11 Apr 2003. The main new features in Lua 5.0 are colaborative multithreading via Lua coroutines, full lexical scoping instead of upvalues, and metatables instead of tags and tag methods. Lua 5.0 also introduces booleans, proper tail calls, and weak tables. Other features are better support for packages, new API for loading Lua chunks, new error handling protocol, better error messages, and much more. Lua 5.0 is the first version to be released under the new license.
apart from booleans none of this should affect "basic" code.
_________________
|
Chromix Cadet
Joined: June 29, 2001 Posts: 3052
| Posted: 2003-05-11 13:40  
API got changed and is incompatible to the current serverside code.
Lots of functions got changed too, as namespaces were introduced which prevents current scripts from working with the new version.
There is no decision yet if/when the LUA version DS uses will be upgraded.
_________________
|
Pope Fleet Admiral
Joined: June 11, 2002 Posts: 2449 From: World of tomorrow
| Posted: 2003-05-11 14:13  
i seem to be unable to quickly locate 4.0 binaries for win32.
_________________
|
Pope Fleet Admiral
Joined: June 11, 2002 Posts: 2449 From: World of tomorrow
| Posted: 2003-05-12 09:52  
next (table [, index])
Allows a program to traverse all fields of a table.
that one.
shouldnt try to write stuff in a new language after 0300 at night..
_________________
|
Chromix Cadet
Joined: June 29, 2001 Posts: 3052
| Posted: 2003-05-12 12:14  
I'll upload a copy of the 4.0 binaries to the staffdir once its working again.
_________________
|