diff --git a/Install_00/Install.ini b/Install_00/Install.ini index 6b497cf..52dd346 100644 --- a/Install_00/Install.ini +++ b/Install_00/Install.ini @@ -4,3 +4,4 @@ File001 = "On.lua","LUA\On.lua" File002 = "Prototype.lua","LUA\Prototype.lua" File003 = "kskit.lua","LUA\kskit.lua" File004 = "Begriffe.lua","LUA\Begriffe.lua" +File005 = "Serializer.lua","LUA\Serializer.lua" diff --git a/Install_00/Serializer.lua b/Install_00/Serializer.lua new file mode 100644 index 0000000..3affff8 --- /dev/null +++ b/Install_00/Serializer.lua @@ -0,0 +1,70 @@ +-- Tabelle in einen String umwandeln, rekursiv +-- Funktionen als Lua-Werte werden ignoriert +function __tostring(tab) + local t=type(tab) + if t=="table" then + local r="" + -- Tabellen-Keys sammeln und sortieren + local tkeys={} + for k in pairs(tab) do table.insert(tkeys, k) end + table.sort(tkeys, function(a,b) return tostring(a)