QAD 实现批量导入菜单(GUI版) -Index2-Control
作者:互联网
1.需要先导入一个设置表结构 xxqcfg_mstr(用Data Administraton工具选择数据库导入)
ADD TABLE "xxqcfg_mstr" AREA "CONTROL" DESCRIPTION "Config for xxqad program " DUMP-NAME "xxqcfg" ADD FIELD "xxqcfg_type" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 2 MAX-WIDTH 36 ORDER 10 ADD FIELD "xxqcfg_id" OF "xxqcfg_mstr" AS character FORMAT "x(40)" INITIAL "" POSITION 3 MAX-WIDTH 80 ORDER 20 ADD FIELD "xxqcfg_chr01" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 4 MAX-WIDTH 36 ORDER 30 ADD FIELD "xxqcfg_chr02" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 5 MAX-WIDTH 36 ORDER 40 ADD FIELD "xxqcfg_chr03" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 6 MAX-WIDTH 36 ORDER 50 ADD FIELD "xxqcfg_chr04" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 7 MAX-WIDTH 36 ORDER 60 ADD FIELD "xxqcfg_chr05" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 8 MAX-WIDTH 36 ORDER 70 ADD FIELD "xxqcfg_chr06" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 9 MAX-WIDTH 36 ORDER 80 ADD FIELD "xxqcfg_chr07" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 10 MAX-WIDTH 36 ORDER 90 ADD FIELD "xxqcfg_chr08" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 11 MAX-WIDTH 36 ORDER 100 ADD FIELD "xxqcfg_chr09" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 12 MAX-WIDTH 36 ORDER 110 ADD FIELD "xxqcfg_chr10" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 13 MAX-WIDTH 36 ORDER 120 ADD FIELD "xxqcfg_chr11" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 14 MAX-WIDTH 36 ORDER 130 ADD FIELD "xxqcfg_chr12" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 15 MAX-WIDTH 36 ORDER 140 ADD FIELD "xxqcfg_chr13" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 16 MAX-WIDTH 36 ORDER 150 ADD FIELD "xxqcfg_chr14" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 17 MAX-WIDTH 36 ORDER 160 ADD FIELD "xxqcfg_chr15" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 18 MAX-WIDTH 36 ORDER 170 ADD FIELD "xxqcfg_chr16" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 19 MAX-WIDTH 36 ORDER 180 ADD FIELD "xxqcfg_chr17" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 20 MAX-WIDTH 36 ORDER 190 ADD FIELD "xxqcfg_chr18" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 21 MAX-WIDTH 36 ORDER 200 ADD FIELD "xxqcfg_chr19" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 22 MAX-WIDTH 36 ORDER 210 ADD FIELD "xxqcfg_chr20" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 23 MAX-WIDTH 36 ORDER 220 ADD FIELD "xxqcfg_chr21" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 24 MAX-WIDTH 36 ORDER 230 ADD FIELD "xxqcfg_chr22" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 25 MAX-WIDTH 36 ORDER 240 ADD FIELD "xxqcfg_chr23" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 26 MAX-WIDTH 36 ORDER 250 ADD FIELD "xxqcfg_chr24" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 27 MAX-WIDTH 36 ORDER 260 ADD FIELD "xxqcfg_chr25" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 28 MAX-WIDTH 36 ORDER 270 ADD FIELD "xxqcfg_chr26" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 29 MAX-WIDTH 36 ORDER 280 ADD FIELD "xxqcfg_chr27" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 30 MAX-WIDTH 36 ORDER 290 ADD FIELD "xxqcfg_chr28" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 31 MAX-WIDTH 36 ORDER 300 ADD FIELD "xxqcfg_chr29" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 32 MAX-WIDTH 36 ORDER 310 ADD FIELD "xxqcfg_chr30" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 33 MAX-WIDTH 36 ORDER 320 ADD FIELD "xxqcfg_chr31" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 34 MAX-WIDTH 36 ORDER 330 ADD FIELD "xxqcfg_chr32" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 35 MAX-WIDTH 36 ORDER 340 ADD FIELD "xxqcfg_chr33" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 36 MAX-WIDTH 36 ORDER 350 ADD FIELD "xxqcfg_chr34" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 37 MAX-WIDTH 36 ORDER 360 ADD FIELD "xxqcfg_chr35" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 38 MAX-WIDTH 36 ORDER 370 ADD FIELD "xxqcfg_chr36" OF "xxqcfg_mstr" AS character FORMAT "x(18)" INITIAL "" POSITION 39 MAX-WIDTH 36 ORDER 380 ADD FIELD "xxqcfg_dte01" OF "xxqcfg_mstr" AS date FORMAT "99/99/99" INITIAL ? POSITION 40 MAX-WIDTH 4 ORDER 390 ADD FIELD "xxqcfg_dte02" OF "xxqcfg_mstr" AS date FORMAT "99/99/99" INITIAL ? POSITION 41 MAX-WIDTH 4 ORDER 400 ADD FIELD "xxqcfg_dte03" OF "xxqcfg_mstr" AS date FORMAT "99/99/99" INITIAL ? POSITION 42 MAX-WIDTH 4 ORDER 410 ADD FIELD "xxqcfg_dte04" OF "xxqcfg_mstr" AS date FORMAT "99/99/99" INITIAL ? POSITION 43 MAX-WIDTH 4 ORDER 420 ADD FIELD "xxqcfg_dtm01" OF "xxqcfg_mstr" AS datetime FORMAT "99/99/9999 HH:MM:SS.SSS" INITIAL ? POSITION 44 MAX-WIDTH 8 ORDER 430 ADD FIELD "xxqcfg_dtm02" OF "xxqcfg_mstr" AS datetime FORMAT "99/99/9999 HH:MM:SS.SSS" INITIAL ? POSITION 45 MAX-WIDTH 8 ORDER 440 ADD FIELD "xxqcfg_int01" OF "xxqcfg_mstr" AS integer FORMAT "->,>>>,>>9" INITIAL "0" POSITION 46 MAX-WIDTH 4 ORDER 450 ADD FIELD "xxqcfg_int02" OF "xxqcfg_mstr" AS integer FORMAT "->,>>>,>>9" INITIAL "0" POSITION 47 MAX-WIDTH 4 ORDER 460 ADD FIELD "xxqcfg_int03" OF "xxqcfg_mstr" AS integer FORMAT "->,>>>,>>9" INITIAL "0" POSITION 48 MAX-WIDTH 4 ORDER 470 ADD FIELD "xxqcfg_int04" OF "xxqcfg_mstr" AS integer FORMAT "->,>>>,>>9" INITIAL "0" POSITION 49 MAX-WIDTH 4 ORDER 480 ADD FIELD "xxqcfg_log01" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 50 MAX-WIDTH 1 ORDER 490 ADD FIELD "xxqcfg_log02" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 51 MAX-WIDTH 1 ORDER 500 ADD FIELD "xxqcfg_log03" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 52 MAX-WIDTH 1 ORDER 510 ADD FIELD "xxqcfg_log04" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 53 MAX-WIDTH 1 ORDER 520 ADD FIELD "xxqcfg_log05" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 54 MAX-WIDTH 1 ORDER 530 ADD FIELD "xxqcfg_log06" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 55 MAX-WIDTH 1 ORDER 540 ADD FIELD "xxqcfg_log07" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 56 MAX-WIDTH 1 ORDER 550 ADD FIELD "xxqcfg_log08" OF "xxqcfg_mstr" AS logical FORMAT "yes/no" INITIAL "no" POSITION 57 MAX-WIDTH 1 ORDER 560 ADD FIELD "xxqcfg_userid" OF "xxqcfg_mstr" AS character FORMAT "x(8)" INITIAL "" POSITION 58 MAX-WIDTH 16 ORDER 570 ADD FIELD "xxqcfg_domain" OF "xxqcfg_mstr" AS character FORMAT "x(8)" INITIAL "" POSITION 59 MAX-WIDTH 16 ORDER 580 ADD FIELD "xxqcfg_lang" OF "xxqcfg_mstr" AS character FORMAT "x(8)" INITIAL "" POSITION 60 MAX-WIDTH 16 ORDER 590 ADD FIELD "xxqcfg_create" OF "xxqcfg_mstr" AS datetime FORMAT "99/99/9999 HH:MM:SS.SSS" INITIAL ? POSITION 61 MAX-WIDTH 8 ORDER 600 ADD INDEX "xxqcfg_type" ON "xxqcfg_mstr" AREA "CONTROL_IDX" PRIMARY INDEX-FIELD "xxqcfg_type" ASCENDING INDEX-FIELD "xxqcfg_id" ASCENDING INDEX-FIELD "xxqcfg_domain" ASCENDING INDEX-FIELD "xxqcfg_lang" ASCENDING . PSC cpstream=CP936 . 0000008470
2.通用主过程 读取设置并显示菜单
/*------------------------------------------------------------------------ File : xxcimgeneral.p Purpose : FOR CIMLOAD COMMON USE Syntax : Description : Author(s) : TERRENCE ZHANG Created : Sat Oct 29 12:54:11 CST 2016 Notes : ----------------------------------------------------------------------*/ {mfdtitle.i} DEFINE INPUT PARAMETER l AS Icimode NO-UNDO. DEFINE VARIABLE c AS cimframe NO-UNDO. DEFINE VARIABLE clsname AS CHARACTER NO-UNDO. /* *************************** Main Block *************************** */ ASSIGN clsname = ENTRY(1,l:tostring(),"_"). c = NEW cimframe(INPUT l). FOR FIRST xxqcfg_mstr WHERE xxqcfg_type = "GUICIMSET" AND xxqcfg_chr01 = clsname AND xxqcfg_chr11 EQ '': ASSIGN xxqcfg_chr11 = ENTRY(1,c:tostring(),"_") + '.cls'. END. IF AVAILABLE xxqcfg_mstr THEN RELEASE xxqcfg_mstr. FIND FIRST xxqcfg_mstr WHERE xxqcfg_type = "GUICIMSET" AND xxqcfg_chr01 = clsname NO-LOCK NO-ERROR. IF AVAILABLE xxqcfg_mstr THEN DO: ASSIGN c:frametitle = xxqcfg_chr02 c:bptitle = xxqcfg_chr03 c:datelab = xxqcfg_chr04 c:togbx = xxqcfg_log02 c:showdate = xxqcfg_log03 c:showtogbx = xxqcfg_log04 c:togbxlab = xxqcfg_chr05 c:togbxmsgf = xxqcfg_chr08 c:togbxmsgt = xxqcfg_chr09 c:labellist = xxqcfg_chr16 c:formatlist = xxqcfg_chr17 c:visiblelist = xxqcfg_chr18. /*更新类名*/ END. ELSE MESSAGE "This Cimload Menu was not set up" VIEW-AS ALERT-BOX WARNING. batchrun = YES. c:waitset(). batchrun = NO. DELETE OBJECT c. c = ?.
运行截图见UIconfig(xxguicimset.p) 里
标签:Control,FIELD,GUI,FORMAT,mstr,QAD,ADD,xxqcfg,ORDER 来源: https://www.cnblogs.com/skyofchaos/p/13776833.html