function order(x)
maxn = table.getn(x)
for j=1,maxn ,1 do
for i = j,maxn,1 do
if x[j].no < x[i].no then
x[j],x[i] = x[i],x[j]
end
end
end
return x
end
以上是以数组的.no项来进行排序的
现在我想把函数调整为orderby(x,y)
其中y代表的是数组中的排序的列名,应该咋实现啊?
茅侃侃
红颜莎娜
萧十郎
随时随地看视频慕课网APP