关于排序的一点点请教
aupha 2008-07-13 10:40:43
不知道在这里发这个问题合不合适,如果有问题,请版主移版(手下留情,让他多呆2天哈)
在一个页面处理中,条件不同,会报不同的警告信息,警告信息只能报一个,所以要有一定的优先顺序,比如如果满足条件4,那么警告信息就报条件4的信息。如果条件4不满足,条件2满足,就报条件2的信息。条件1~12都不满足的话(条件6,7不报错),就报其他的条件的信息。现在的报错顺序是10>11>12>4>5>8>9 ,从排序上如何实现呢?想了半天了,没想出来。
过程1
if 其他条件 then
add 1 to idx
move errNumN to w_Msg_cd
end
if 条件1 then
add 1 to idx
move errNum1 to w_Msg_cd
end if
if 条件2 then
add 1 to idx
move errNum2 to w_Msg_cd
end if
if 条件3 then
add 1 to idx
move errNum3 to w_Msg_cd
end if
if 条件4 then
add 1 to idx
move errNum4 to w_Msg_cd
end if
if 条件5 then
add 1 to idx
move errNum5 to w_Msg_cd
end if
...
if 条件8 then
add 1 to idx
move errNum8 to w_Msg_cd
end if
...
if 条件12 then
add 1 to idx
move errNum12 to w_Msg_cd
end if
过程1
然后进行循环idx ,如果outmsg(输出的警告信息)里面没有值,msg赋给outmsg.
for idx = 1 to 20 , 1 ++
读取数据库:
select msg from msg_tbl where msg_cd = w_Msg_cd
if 条件6 and outmsg = space then
move msg to outmsg
end if
end for
===============================
ps:写的有点乱,大家先54我的语法错误哈。大体意思就是这样的。