分享
 
 
 

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

王朝other·作者佚名  2006-11-24
窄屏简体版  字體: |||超大  

################################################################################

# #

# 版本号: 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] = "设定大类险种、明细险种及交费方式信息"

let hlpmenu[3,4] = "设定各明细险种的佣金参数"

let hlpmenu[3,5] = "退出柜面处理系统"

let poprowno[4] = 5

let popmenu[4,1] = "1.系统版本信息"

let popmenu[4,2] = "2.系统开发环境"

let popmenu[4,3] = "3.系统操作指南"

let popmenu[4,4] = "4.信息反馈简介"

let popmenu[4,5] = "E.退 出" let hlpmenu[4,1] = "显示柜面处理系统的相关版本信息"

let hlpmenu[4,2] = "显示柜面处理系统的开发及应用环境"

let hlpmenu[4,3] = "显示柜面处理系统的各种操作指南"

let hlpmenu[4,4] = "显示本系统的信息反馈方式或获取相关资料"

let hlpmenu[4,5] = "退出柜面处理系统" let winopened = "N"

end function #####################################################

# 函数名称: dispmenu() #

# 作 用: 显示菜单函数 #

# 参 数: oper: = 0 显示菜单和选择 #

#####################################################

function dispmenu(oper)

define oper smallint

define i,j,k smallint

define answ char(1)

define cstart smallint

while true

current window is mtwin

let p_today = today using " mmm dd,yyyy "

#display p_today at 1,66 attribute(reverse,underline)

display "作者: 大梦 " at 1,66 attribute(reverse,underline)

for i = 1 to 4

let j = (i-1) * 16 + 1

display thrmenu[i] at 1,j

end for

let j = (menuno-1) * 16 + 1

display thrmenu[menuno] at 1,j attribute(reverse)

if currow <> 0 then

let cstart = (menuno-1)*16 + 3

let i = poprowno[menuno] + 1

if winopened = "N" then

open window popwin at rstart, cstart with i rows , 14 columns attribute (border,prompt line i)

let winopened = "Y"

else

current window is popwin

end if

for i = 1 to poprowno[menuno]

display popmenu[menuno,i] at i,1

end for

display popmenu[menuno,currow] at currow,1 attribute(reverse)

end if

if oper = 1 then

return

end if

while true

prompt " 请 选 择:" for char answ

on key (up)

if currow = 1 then

display popmenu[menuno,currow] at currow,1

let currow = poprowno[menuno]

else

if currow <> 1 and currow <> 0 then

display popmenu[menuno,currow] at currow,1

let currow = currow - 1

end if

end if

display popmenu[menuno,currow] at currow,1 attribute(reverse)

on key (down)

if currow = poprowno[menuno] then

display popmenu[menuno,currow] at currow,1

let currow = 1

else

if currow <> poprowno[menuno] and currow <> 0 then

display popmenu[menuno,currow] at currow,1

let currow = currow + 1

end if

end if

display popmenu[menuno,currow] at currow,1 attribute(reverse)

on key (left)

if winopened = "Y" then

close window popwin

let winopened = "N"

end if

if menuno > 1 then

let menuno = menuno - 1

else

let menuno = maxmenuno

end if

if poprowno[menuno] <> 0 then

let currow = 1

else

let currow = 0

end if

exit while on key (tab,right)

if winopened = "Y" then

close window popwin

let winopened = "N"

end if

if menuno < maxmenuno then

let menuno = menuno + 1

else

let menuno = 1

end if

if poprowno[menuno] <> 0 then

let currow = 1

else

let currow = 0

end if

exit while on key (control-z,return)

return

end prompt

if answ matches "[Ee]" then

let currow = poprowno[menuno]

return

end if

case

when answ matches "[Aa]"

if winopened = "Y" then

close window popwin

let winopened = "N"

end if

let menuno = 1

exit while

when answ matches "[Bb]"

if winopened = "Y" then

close window popwin

let winopened = "N"

end if

let menuno = 2

exit while

when answ matches "[Cc]"

if winopened = "Y" then

close window popwin

let winopened = "N"

end if

let menuno = 3

exit while

when answ matches "[Dd]"

if winopened = "Y" then

close window popwin

let winopened = "N"

end if

let menuno = 4

exit while

end case

if answ >= poprowno[menuno] or answ is null or answ < 1 then

continue while

else

if answ < poprowno[menuno] then

let currow = answ

return

end if

end if

end while

end while

end function

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有