|
Thamk you very much Jeremy, but it doesn't work:
Tracing the code, I saw that this "while" cycle is done only once (but should be done 3 times) and the program quits.Here we go, hopefully I don't fat finger anything in here :) procedure LoadToArray(L : PLua_State; TableName : String; var LoadInto : array of RecType); var idxTable, idxTemp, idxSubTable : Integer; Key, SubKey : String; SubVal : Double; begin SetLength(LoadInto, 0); lua_pushstring(L, PChar(TableName)); lua_gettable(L, LUA_GLOBALSINDEX); if lua_type(L, -1) <> LUA_TTABLE then raise exception.Create('Table expected for identifier "'+TableName+'"'); idxTable := lua_gettop(L); lua_pushnil(L);
while (lua_next(L, idxTable)<>0) do begin
Could you please patch it? Thanks! jk