在return MaxVal 前面插入这段
for each i as integer = 0 to Args.length - 1
if MaxVal = args(i) then i= i+1
return i
end if
next