informix-4gl 7.2编写的通用菜单函数


################################################################################
# #
# 版本号: Ver 1.0 研制时间:2001.2.15 #
# #
################################################################################
globals
define winopened char(1)
define thrmenu array[4] of char(16)
define popmenu array[4,5] of char(14)
define hlpmenu array[4,5] of char(60)
define poprowno array[4] of smallint
define maxmenuno smallint
define menuno, currow, rstart smallint
define p_branch_no char(6)
define p_branch_name char(60)
define p_today char(13)
define p_clerk_code char(10)
define p_clerk_pass char(15)
end globals
main
options message line last,
comment line last-2,
error line last,
prompt line last-1,
form line first 1,
input wrap,
accept key interrupt
options delete key control-o
options insert key control-i
options next key control-n
options previous key control-p
options accept key control-z
defer interrupt
# set isolation to dirty read
# set lock mode to wait 5
# whenever error continue
# call startlog("err.log")

let p_branch_no = arg_val(1)
let p_clerk_code = arg_val(2)
let p_clerk_pass = arg_val(3)
call initmenu()
open window mtwin at 2,2 with 1 rows,78 columns attribute(border)
open window mswin at 5,2 with 18 rows,78 columns attribute(border)
while true
call dispmenu(0)
case menuno
when 1
case currow
when 1
when 2
when 3
when 4
when 5 exit while
end case
when 2
case currow
when 1
when 2
when 3
when 4
when 5 exit while
end case
when 3
case currow
when 1
when 2
when 3
when 4
when 5 exit while
end case
when 4
case currow
when 1
when 2
when 3
when 4
when 5 exit while
end case
end case
end while
close window popwin
close window mswin
close window mtwin
end main#####################################################
# 函数名称: initmenu() #
# 作 用: 初始化菜单函数 #
#####################################################
function initmenu()
define i smallint
let menuno = 1
let currow = 1
let rstart = 4
initialize thrmenu to null
initialize popmenu to null let maxmenuno = 4 let thrmenu[1] = " A.柜面处理模块 "
let thrmenu[2] = " B.数据报表模块 "
let thrmenu[3] = " C.参数维护模块 "
let thrmenu[4] = " D.系统帮助模块 "

let poprowno[1] = 5
let popmenu[1,1] = "1.原始数据维护"
let popmenu[1,2] = "2.日清日结处理"
let popmenu[1,3] = "3.佣金数据查询"
let popmenu[1,4] = "4.综合查询处理"
let popmenu[1,5] = "E.退 出"let hlpmenu[1,1] = "对各机构的原始数据进行查询、增、删、改处理"
let hlpmenu[1,2] = "对各机构录入的数据进行日清日洁处理"
let hlpmenu[1,3] = "对各机构的业务员,部门进行佣金统计处理"
let hlpmenu[1,4] = "对各机构的数据进行综合查询处理"
let hlpmenu[1,5] = "退出柜面处理系统"

let poprowno[2] = 5
let popmenu[2,1] = "1.佣金统计报表"
let popmenu[2,2] = "2.个人统计报表"
let popmenu[2,3] = "3.部门统计报表"
let popmenu[2,4] = "4.机构统计报表"
let popmenu[2,5] = "E.退 出"let hlpmenu[2,1] = "对各机构业务员的佣金信息进行打印处理"
let hlpmenu[2,2] = "分机构对业务员进行综合统计"
let hlpmenu[2,3] = "分机构对部门进行综合统计"
let hlpmenu[2,4] = "分机构进行综合统计"
let hlpmenu[2,5] = "退出柜面处理系统"let poprowno[3] = 5
let popmenu[3,1] = "1.机构部门维护"
let popmenu[3,2] = "2.人员信息维护"
let popmenu[3,3] = "3.险种信息维护"
let popmenu[3,4] = "4.佣金参数维护"
let popmenu[3,5] = "E.退 出"

let hlpmenu[3,1] = "设定机构、部门信息"
let hlpmenu[3,2] = "设业务员基本信息"
let hlpmenu[3,3] = "设定大类险种、明细险种及交费方式信息"

推荐阅读