import console; tb1={2;4;3;1;} tb2 = { {1;4;}; {3;5;}; {2;3;}; } table.sort(tb1); console.dump(tb1); //按一列排序 table.sort(tb2,function(other){return owner[1]<other[1]}); console.dump(tb2); //按二列排序 table.sort(tb2,function(other){return owner[2]<other[[2]}); console.dump(tb2); console.pause(true);
还有个差不多的。
import console;
tb1 = {2;4;3;1}
tb2 = {
{1;4};
{3;5};
{2;3};
}
table.sort(tb1)
console.dump(tb1)
table.sort(tb2,lambda(other){owner[1] < other[1]})
console.dump(tb2)
table.sort(tb2,lambda(other){owner[2] < other[2]})
console.dump(tb2)
console.pause(true);
tb1 = {2;4;3;1}
tb2 = {
{1;4};
{3;5};
{2;3};
}
table.sort(tb1)
console.dump(tb1)
table.sort(tb2,lambda(other){owner[1] < other[1]})
console.dump(tb2)
table.sort(tb2,lambda(other){owner[2] < other[2]})
console.dump(tb2)
console.pause(true);
直接拿走用。。
发表评论