need to use a callback function to accomplish this
out
str s=
;cbc :sub.Sub7 ;;1test
;cbc :sub.Sub6 ;;2test
;ax :sub.Sub5 ;;1test
;ax :sub.Sub4 ;;3test
;ax :sub.Sub3 ;;2test
;ax :sub.Sub2 ;;4test
;zbc :sub.Sub1 ;;test1
ARRAY(str) a=s
a.sort(2 sub.Callback_q_sort)
s=a
out s.rtrim
#sub Callback_q_sort
function# param str&a str&b
str s.gett(a -1 ":") ;str ss.gett(b -1 ":")
if(StrCompare(s ss)=0)
,ret StrCompare(a+findcr(a ';')+1 b+findcr(b ';')+1 1)
else
,ret StrCompare(a b 1)