Open mrpierrot opened 2 months ago
for idx, val in ipairs(cshap_array_or_lua_array) do
end
That don't works with csharp array :
I will have an error like that : LuaException: xlua/util.lua:36: index out of range! i =4, array.Length=4
That don't works with csharp array : I will have an error like that :
LuaException: xlua/util.lua:36: index out of range! i =4, array.Length=4
use pairs
instead of ipairs
Hi.
I would like to know how to correctly manage indexes of array/list instanced from CS ? In CS : array/list indexes start at 0. In Lua : table indexes start at 1.
If I have a function that return an CS array in lua, this is a mess to iterate over. And in my code, I can use lua table and CS array for equivalent usage. That is a big mess.
What do you recommand for that ? Convert manually array/list in lua table (in CS or lua env ? What the best practices for that ?
Thank you