请教:排序函数错误

[ 1823 查看 / 1 回复 ]

运行程序时,显示"非法排序函数"的消息框。
下面是调用数组排序函数的语句,以及排序函数
table.sort(今正常买总结,今正常买总结比较函数);

--  ★★  今正常买总结比较函数  ★★
今正常买总结比较函数 = function(a,b)
if a[5]==a[3] then do return true; end; end;
if a[5]==a[4] then do return false; end; end;
    return a[8]>b[8] ;
end;
11.jpg ()

jpg (2009-6-10 12:15:11)

EXIF信息

11.jpg

分享 转发
TOP

if a[5]==a[3] then do return true
语句中没有括号  容易造成运算错误
if (a[5]==a[3]) then do return true
TOP