Diferencia entre revisiones de «Módulo:Tablas»

Sin resumen de edición
Sin resumen de edición
Línea 2: Línea 2:


function z.mostrar(tabla, identacion)
function z.mostrar(tabla, identacion)
     identacion = identacion or '\n'
     identacion = identacion or '\n '
     local resultado = ''
     local resultado = ''
   
   
     for k,v in pairs(tabla) do
     for k,v in pairs(tabla) do
         if type(v)=='table' then
         if type(v)=='table' then
             resultado = resultado .. identacion .. k .. ': {' .. mostrar(v,identacion .. ' __') .. '}'
             resultado = resultado .. identacion .. k .. ': {' .. mostrar(v,identacion .. '__') .. '}'
         elseif type(v)=='string' then
         elseif type(v)=='string' then
         resultado = resultado .. identacion .. k .. ': "' .. v .. '"'
         resultado = resultado .. identacion .. k .. ': "' .. v .. '"'