Module:TestTableau : Différence entre versions

De X-Wing 2.0 - Le wiki des figurines
Aller à : navigation, rechercher
Ligne 18 : Ligne 18 :
 
           value = "Null"
 
           value = "Null"
 
       end
 
       end
       retour  = retour .. "-- " .. key .. "?" .. type(value) .. "\n"
+
       if type(value) == "table" then
       --retour = retour .. "-- " .. key .. "?" .. value .. "\n"
+
          tprint(value)
 +
       else
 +
          retour = retour .. "-- " .. key .. "?" .. value .. "\n"
 +
      end
 
   end
 
   end
 
   return retour
 
   return retour

Version du 26 juillet 2019 à 11:20

La documentation pour ce module peut être créée à Module:TestTableau/doc

local p = {}

local Data = {}
local DataSSTab1 = mw.loadData('Module:TestTableau/SSTab1')
local DataSSTab1 = mw.loadData('Module:TestTableau/SSTab2')
Data["SSTab1"] = DataSSTab1
Data["SSTab2"] = DataSSTab2



function tprint(t) 
   local retour = ""   
   for key,value in pairs(t) do
       if key == nil then
           key = "Null"
       end
       if value == nil then
           value = "Null"
       end
       if type(value) == "table" then
           tprint(value)
       else
           retour = retour .. "-- " .. key .. "?" .. value .. "\n"
       end
   end
   return retour
end

function p.affichage(frame)
    return tprint(Data)
end

return p