Page 1 of 1

sorting subtables

Posted: Mon Jun 24, 2024 11:34 am
by ilbarbax
Sorry, probably it's my short comprehension, but how can I use the sort command to sort a table by a subtable?

i.e.
t={}
t[0]={name="pippo",age=32}
t[1]={name="pluto",age=24}
t[2]={name="ilBarbax",age=66}

Sort(t.name) does not work

Re: sorting subtables

Posted: Mon Jun 24, 2024 12:51 pm
by Flinx
For this example try

Code: Select all

Sort(t, Function(a, b) Return(a.name < b.name) EndFunction)