不知道在这里发这个问题合不合适,如果有问题,请版主移版(手下留情,让他多呆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我的语法错误哈。大体意思就是这样的。
else if
else if
...
并且,条件数大于30,每个条件都有不同的处理。现在要做的是,在尽量不动原来程序逻辑的基础上,添加部分代码来实现这个功能。我想在条件1-12的判断处理中,加一个flag来进行判断,然后在循环处理中
for idx = 1 to 20 , 1 ++
读取数据库:
select msg from msg_tbl where msg_cd = w_Msg_cd
if 条件6 then
if and outmsg = space and flag = 1
move msg to outmsg
else if flag ≠ 1
move msg to outmsg1 'outmsg1是临时变量
end if
end if
end for if outmsg = space and outmsg1 ≠ space then
move outmsg1 to outmsg
end if 现在的问题是如何在条件中再排序下。
其中条件这里
if 条件2 then
add 1 to idx
move errNum2 to w_Msg_cd(idx)
end if
写到了一个集团变量里面的。