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
SetLength(LoadInto, Length(LoadInto)+1);