lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> mytab = {a = 1, b = 2, c = {ca = 5, cb = 7, cc = 9}, d = 3, e = {ea = 12, eb
> = {eea = 69, eeb = 72}, ec = 48}}
>
> function savetab(t)
> 	for i, v in t do
> 		if type(v) == "table" then
> 			savetab(v)
> 			return

It's this return that's the problem: it's stopping as soon as the first
subtable has been dealt with, as you say! Just remove it.

Then I get:

Savetab: a=1
Savetab: ca=5
Savetab: cc=9
Savetab: cb=7
Savetab: b=2
Savetab: eea=69
Savetab: eeb=72
Savetab: ea=12
Savetab: ec=48
Savetab: d=3

which looks about right.