![]() | |||||||||
| |||||||||
Lua-ApiCore |
print_rfunction print_r ( t ) local print_r_cache={} local function sub_print_r(t,indent) if (print_r_cache[tostring(t)]) then print(indent.."*"..tostring(t)) else print_r_cache[tostring(t)]=true if (type(t)=="table") then for pos,val in pairs(t) do if (type(val)=="table") then print(indent.."["..pos.."] => "..tostring(t).." {") sub_print_r(val,indent..string.rep(" ",string.len(pos)+8)) print(indent..string.rep(" ",string.len(pos)+6).."}") else print(indent.."["..pos.."] => "..tostring(val)) end end else print(indent..tostring(t)) end end end sub_print_r(t," ") end
Quite similar to PHP's print_r you can retrieve all data in a specific lua table or variable. Code xtab={} Comments |
||||||||
| © 2007 DracoBlue :: Valid XHTML, CSS, RSS Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | SourceNet © 2007, DracoBlue :: Page created in 0.151 seconds with 53 queries. | |||||||||