單檔模板(tiptop新手開(kāi)發(fā)神器)_第1頁(yè)
單檔模板(tiptop新手開(kāi)發(fā)神器)_第2頁(yè)
單檔模板(tiptop新手開(kāi)發(fā)神器)_第3頁(yè)
單檔模板(tiptop新手開(kāi)發(fā)神器)_第4頁(yè)
單檔模板(tiptop新手開(kāi)發(fā)神器)_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、#tiptop新手開(kāi)發(fā)神器單檔多欄開(kāi)發(fā)模板#單檔模板-多欄維護(hù)檔#Alfa 精心制作 made in china 296066606DATABASE ds GLOBALS "././config/top.global" DEFINE g_tc_omg DYNAMIC ARRAY OF RECORD #程式變數(shù)(Program Variables) tc_omg01 LIKE tc_omg_file.tc_omg01, tc_omg02 LIKE tc_omg_file.tc_omg02, tc_omg03 LIKE tc_omg_file.tc_omg03, tc_omg0

2、4 LIKE tc_omg_file.tc_omg04, tc_omg05 LIKE tc_omg_file.tc_omg05, tc_omg06 LIKE tc_omg_file.tc_omg06, tc_omg07 LIKE tc_omg_file.tc_omg07, tc_omg08 LIKE tc_omg_file.tc_omg08, tc_omg09 LIKE tc_omg_file.tc_omg09, tc_omg10 LIKE tc_omg_file.tc_omg10, tc_omgacti LIKE tc_omg_file.tc_omgacti END RECORD, g_tc

3、_omg_t DYNAMIC ARRAY OF RECORD #程式變數(shù)(Program Variables) tc_omg01 LIKE tc_omg_file.tc_omg01, tc_omg02 LIKE tc_omg_file.tc_omg02, tc_omg03 LIKE tc_omg_file.tc_omg03, tc_omg04 LIKE tc_omg_file.tc_omg04, tc_omg05 LIKE tc_omg_file.tc_omg05, tc_omg06 LIKE tc_omg_file.tc_omg06, tc_omg07 LIKE tc_omg_file.tc

4、_omg07, tc_omg08 LIKE tc_omg_file.tc_omg08, tc_omg09 LIKE tc_omg_file.tc_omg09, tc_omg10 LIKE tc_omg_file.tc_omg10, tc_omgacti LIKE tc_omg_file.tc_omgacti END RECORD, b_tc_omg RECORD LIKE tc_omg_file.*, g_wc2,g_sql LIKE type_file.chr1000, #No.FUN-680102CHAR(300), g_rec_b LIKE type_file.num5, #單身筆數(shù) #

5、No.FUN-680102 SMALLINT l_ac LIKE type_file.num5 #目前處理的ARRAY CNT #No.FUN-680102 SMALLINT DEFINE g_forupd_sql STRING #SELECT . FOR UPDATE SQL DEFINE g_cnt LIKE t ype_file.num10 #No.FUN-680102 INTEGERDEFINE g_i LIKE type_file.num5 #count/index for any purpose #No.FUN-680102 SMALLINTDEFINE g_before_inpu

6、t_done LIKE type_file.num5 #FUN-570110 #No.FUN-680102 SMALLINT#主程式開(kāi)始MAINDEFINE p_row,p_col LIKE type_file.num5 #No.FUN-680102 SMALLINT OPTIONS #改變一些系統(tǒng)預(yù)設(shè)值 INPUT NO WRAP #輸入的方式: 不打轉(zhuǎn) DEFER INTERRUPT #擷取中斷鍵, 由程式處理 IF (NOT cl_user() THEN EXIT PROGRAM END IF WHENEVER ERROR CALL cl_err_msg_log #紀(jì)錄錯(cuò)誤訊息 IF (

7、NOT cl_setup("CSF") THEN #程序執(zhí)行的基本設(shè)定 EXIT PROGRAM #如果模組不對(duì),程序仍然可以執(zhí)行,但是action則不能顯示系統(tǒng)設(shè)定的中文描述 END IF CALL cl_used(g_prog,g_time,1) RETURNING g_time #計(jì)算使用時(shí)間 (進(jìn)入時(shí)間) #No.MOD-580088 HCN 20050818 #No.FUN-6A0081 LET p_row = 4 LET p_col = 15 #界面的大小 方位 OPEN WINDOW i535_w AT p_row,p_col WITH FORM "

8、csf/42f/csfi535" ATTRIBUTE (STYLE = g_win_style CLIPPED) #No.FUN-580092 HCN CALL cl_ui_init() #用途:程序設(shè)定初始化 語(yǔ)言! #LET g_wc2 = '1=1' #讓程序進(jìn)入就查詢出所有的資料 #CALL i527_b_fill(g_wc2) CALL i535_menu() #呼叫菜單 CLOSE WINDOW i535_w #結(jié)束畫(huà)面 CALL cl_used(g_prog,g_time,2) RETURNING g_time #計(jì)算使用時(shí)間 (退出使間) #No.MO

9、D-580088 HCN 20050818 #No.FUN-6A0081 END MAIN FUNCTION i535_menu() #主程序驅(qū)動(dòng)DEFINE l_cmd LIKE type_file.chr1000 #No.FUN-780056 WHILE TRUE CALL i535_bp("G") #GP 按鈕驅(qū)動(dòng) CASE g_action_choice #按鈕 WHEN "query" IF cl_chk_act_auth() THEN CALL i535_q() #呼叫查詢 END IF WHEN "detail" IF

10、cl_chk_act_auth() THEN CALL i535_b() #呼叫單身 ELSE LET g_action_choice = NULL END IF WHEN "help" CALL cl_show_help() #呼叫幫助 WHEN "exit" EXIT WHILE #退出程序 WHEN "controlg" CALL cl_cmdask() #Ctlr + G WHEN "related_document" #相關(guān)文件 IF cl_chk_act_auth() THEN IF g_tc_xga.

11、tc_xga01 IS NOT NULL THEN LET g_doc.column1 = "tc_xga01" LET g_doc.value1 = g_tc_xga.tc_xga01 CALL cl_doc() END IF END IF WHEN "exporttoexcel" #匯出excel IF cl_chk_act_auth() THEN CALL cl_export_to_excel(ui.Interface.getRootNode(),base.TypeInfo.create(g_tc_omg),'',''

12、;) END IF END CASE END WHILEEND FUNCTION FUNCTION i535_q() #查詢函數(shù) CALL i535_b_askkey()END FUNCTIONFUNCTION i535_b_askkey() #查詢函數(shù) CLEAR FORM CALL g_tc_omg.clear() CONSTRUCT g_wc2 ON tc_omg01,tc_omg02,tc_omg03,tc_omg04,tc_omg05,tc_omg07,tc_omg10,tc_omgacti #允許在查詢時(shí)輸入作為查詢條件的欄位 FROM s_tc_omg1.tc_omg01,s_t

13、c_omg1.tc_omg02,s_tc_omg1.tc_omg03,s_tc_omg1.tc_omg04, s_tc_omg1.tc_omg05,s_tc_omg1.tc_omg07,s_tc_omg1.tc_omg10,s_tc_omg1.tc_omgacti #對(duì)應(yīng)畫(huà)面黨的欄位 BEFORE CONSTRUCT CALL cl_qbe_init() #預(yù)設(shè)QBE 及g_qbe_code 的值 ON ACTION CONTROLP #程序開(kāi)窗-CONSTRUCT模式 CASE WHEN INFIELD(tc_obk01) CALL cl_init_qry_var() LET g_qrypa

14、ram.form = "q_occ" LET g_qryparam.state = "c" #多選 CALL cl_create_qry() RETURNING g_qryparam.multiret DISPLAY g_qryparam.multiret TO tc_obk01 NEXT FIELD tc_obk01 END CASE ON IDLE g_idle_seconds CALL cl_on_idle() #在ON IDLE 時(shí)的處理 CONTINUE CONSTRUCT ON ACTION about #MOD-4C0121 CALL cl

15、_about() #程序信息 ON ACTION help #MOD-4C0121 CALL cl_show_help() #顯示程序的說(shuō)明檔案 ON ACTION controlg #MOD-4C0121 CALL cl_cmdask() #詢問(wèn)用戶欲執(zhí)行的程序,并執(zhí)行之 ON ACTION qbe_select #條件查詢 CALL cl_qbe_select() ON ACTION qbe_save #條件存儲(chǔ) CALL cl_qbe_save() #No.FUN-580031 -end- HCN END CONSTRUCT #LET g_wc2 = g_wc2 CLIPPED,cl_g

16、et_extra_cond('tc_omguser','tc_omggrup') #權(quán)限的檢查 IF INT_FLAG THEN LET INT_FLAG = 0 LET g_wc2 = NULL RETURN END IF CALL i535_b_fill(g_wc2) END FUNCTIONFUNCTION i535_b_fill(p_wc2) #BODY FILL UP欄位 查詢DEFINE p_wc2 LIKE type_file.chr1000 LET g_sql = "SELECT tc_omg01,tc_omg02,tc_omg03,t

17、c_omg04,tc_omg05,tc_omg07,tc_omg10,tc_omgacti", #FUN-4B0060 " FROM tc_omg_file ", " WHERE ", p_wc2 CLIPPED, #單身 " ORDER BY 1" PREPARE i535_pb FROM g_sql DECLARE tc_omg_curs CURSOR FOR i535_pb CALL g_tc_omg.clear() LET g_cnt = 1 MESSAGE "Searching!" FOREAC

18、H tc_omg_curs INTO g_tc_omgg_cnt.* #單身 ARRAY 填充 IF SQLCA.SQLCODE THEN CALL CL_ERR('FOREACH:',SQLCA.SQLCODE,1) EXIT FOREACH END IF LET g_cnt = g_cnt + 1 #筆數(shù)+1 循環(huán) IF g_cnt > g_max_rec THEN #超過(guò)系統(tǒng)參數(shù)設(shè)定最大值則停止循環(huán),并顯示當(dāng)前 CALL cl_err( '', 9035, 0 ) EXIT FOREACH END IF END FOREACH CALL g_tc_o

19、mg.deleteElement(g_cnt) MESSAGE "" LET g_rec_b = g_cnt-1 DISPLAY g_rec_b TO FORMONLY.cn2 #顯示 LET g_cnt = 0 END FUNCTION FUNCTION i535_b() #維護(hù)單身的資料DEFINE l_ac_t LIKE type_file.num5, #未取消的ARRAY CNT l_n LIKE type_file.num5, #檢查重複用 l_lock_sw LIKE type_file.chr1, #單身鎖住否 p_cmd LIKE type_file.chr

20、1, #處理狀態(tài) l_allow_insert LIKE type_file.chr1, #可新增否 l_allow_delete LIKE type_file.chr1 #可刪除否 IF s_shut(0) THEN RETURN END IF CALL cl_opmsg('b') #宣告這是B LET g_action_choice = "" #讓按鈕等與 LET l_allow_insert = cl_detail_input_auth('insert') LET l_allow_delete = cl_detail_input_aut

21、h('delete') LET g_forupd_sql = "SELECT tc_omg01,tc_omg02,tc_omg03,tc_omg04,tc_omg05,tc_omg07,tc_omg10,tc_omgacti", #FUN-4B0060 " FROM tc_omg_file WHERE tc_omg01= ? FOR UPDATE" LET g_forupd_sql = cl_forupd_sql(g_forupd_sql) DECLARE i535_bcl CURSOR FROM g_forupd_sql # LOCK

22、CURSOR INPUT ARRAY g_tc_omg WITHOUT DEFAULTS FROM s_tc_omg.* #輸入數(shù)組 在s_tc_xgb里邊傳去畫(huà)面黨(畫(huà)面黨那邊對(duì)應(yīng)的數(shù)組也必須是s_tc_omg) ATTRIBUTE (COUNT=g_rec_b,MAXCOUNT=g_max_rec,UNBUFFERED, INSERT ROW = l_allow_insert,DELETE ROW=l_allow_delete,APPEND ROW=l_allow_insert) -寫死的 我也不想去了解誒 BEFORE INPUT #輸入之前 IF g_rec_b != 0 THEN C

23、ALL fgl_set_arr_curr(l_ac) END IF BEFORE ROW #輸入一行之前 LET p_cmd='' LET l_ac = ARR_CURR() #返回程序陣列的當(dāng)前記錄號(hào) LET l_lock_sw = 'N' #DEFAULT LET l_n = ARR_COUNT() IF g_rec_b>=l_ac THEN BEGIN WORK # 開(kāi)始作業(yè) LET p_cmd='u' LET g_before_input_done = FALSE CALL i535_set_entry(p_cmd) #設(shè)置允許輸入

24、欄位 CALL i535_set_no_entry(p_cmd) #設(shè)置不允許輸入欄位 LET g_before_input_done = TRUE LET g_tc_omg_t.* = g_tc_omgl_ac.* #備份當(dāng)前值 OPEN i535_bcl USING g_tc_omg_t.tc_omg01 #鎖表(根據(jù)表的屬性,把表主鍵放這里) IF STATUS THEN CALL cl_err("OPEN i535_bcl:", STATUS, 1) LET l_lock_sw = "Y" ELSE FETCH i535_bcl INTO g_t

25、c_omgl_ac.* IF SQLCA.sqlcode THEN CALL cl_err(g_tc_omg_t.tc_omg01,SQLCA.sqlcode,1) LET l_lock_sw = "Y" END IF END IF CALL cl_show_fld_cont() #設(shè)定p_per內(nèi)有特殊格式設(shè)定的欄位 END IF BEFORE INSERT #INSERT之前 LET l_n = ARR_COUNT() #返回程序陣列個(gè)數(shù) LET p_cmd='a' LET g_before_input_done = FALSE CALL i535_se

26、t_entry(p_cmd) #設(shè)置允許輸入欄位 CALL i535_set_no_entry(p_cmd) #設(shè)置不允許輸入欄位 LET g_before_input_done = TRUE INITIALIZE g_tc_omgl_ac.* TO NULL #錄入新資料之前格式化數(shù)組 LET g_tc_omgl_ac.tc_omgacti = 'Y' #設(shè)置新資料默認(rèn)值 LET g_tc_omg_t.* = g_tc_omgl_ac.* #新輸入資料 CALL cl_show_fld_cont() #設(shè)定p_per內(nèi)有特殊格式設(shè)定的欄位 NEXT FIELD tc_omg0

27、1 #首個(gè)輸入值 AFTER INSERT #離開(kāi) INSERT之后 IF INT_FLAG THEN CALL cl_err('',9001,0) LET INT_FLAG = 0 CLOSE i535_bcl CANCEL INSERT END IF CALL i535_move_back() INSERT INTO tc_omg_file VALUES (b_tc_omg.*) IF SQLCA.SQLCODE THEN CALL cl_err3("ins","tc_omg_file",g_tc_omgl_ac.tc_omg01,&

28、quot;",SQLCA.sqlcode,"","",1) #No.FUN-660131 CANCEL INSERT ELSE MESSAGE 'INSERT O.K' LET g_rec_b=g_rec_b+1 DISPLAY g_rec_b TO FORMONLY.cn2 COMMIT WORK END IF AFTER FIELD tc_omg01 #check 編號(hào)是否重複 IF NOT cl_null(g_tc_omgl_ac.tc_omg01) THEN IF g_tc_omgl_ac.tc_omg01 != g_t

29、c_omg_t.tc_omg01 OR g_tc_omg_t.tc_omg01 IS NULL THEN SELECT count(*) INTO l_n FROM tc_omg_file WHERE tc_omg01 = g_tc_omgl_ac.tc_omg01 IF l_n > 0 THEN CALL cl_err('',-239,0) LET g_tc_omgl_ac.tc_omg01 = g_tc_omg_t.tc_omg01 NEXT FIELD tc_omg01 END IF END IF END IF BEFORE DELETE #是否取消單身 IF g_

30、tc_omg_t.tc_omg01 IS NOT NULL THEN IF NOT cl_delete() THEN CANCEL DELETE END IF INITIALIZE g_doc.* TO NULL #No.FUN-9B0098 10/02/24 LET g_doc.column1 = "tc_omg01" #No.FUN-9B0098 10/02/24 LET g_doc.value1 = g_tc_omgl_ac.tc_omg01 #No.FUN-9B0098 10/02/24 CALL cl_del_doc() #No.FUN-9B0098 10/02/

31、24 IF l_lock_sw = "Y" THEN CALL cl_err("", -263, 1) CANCEL DELETE END IF DELETE FROM tc_omg_file WHERE tc_omg01 = g_tc_omg_t.tc_omg01 IF SQLCA.SQLCODE THEN CALL cl_err3("del","tc_omg_file",g_tc_omg_t.tc_omg01,"",SQLCA.SQLCODE,"",""

32、;,1) EXIT INPUT END IF LET g_rec_b=g_rec_b-1 DISPLAY g_rec_b TO FORMONLY.cn2 COMMIT WORK END IF ON ROW CHANGE IF INT_FLAG THEN #新增程式段 CALL cl_err('',9001,0) LET INT_FLAG = 0 LET g_tc_omgl_ac.* = g_tc_omg_t.* CLOSE i535_bcl ROLLBACK WORK EXIT INPUT END IF IF l_lock_sw="Y" THEN CALL

33、cl_err(g_tc_omgl_ac.tc_omg01,-263,0) LET g_tc_omgl_ac.* = g_tc_omg_t.* ELSE CALL i535_move_back() UPDATE tc_omg_file SET * = b_tc_omg.* WHERE tc_omg01 = g_tc_omg_t.tc_omg01 IF SQLCA.sqlcode THEN CALL cl_err3("upd","tc_omg_file",g_tc_omg_t.tc_omg01,"",SQLCA.sqlcode,"

34、;","",1) #No.FUN-660131 LET g_tc_omgl_ac.* = g_tc_omg_t.* ELSE MESSAGE 'UPDATE O.K' COMMIT WORK END IF END IF AFTER ROW #離開(kāi)這些行列之后 LET l_ac = ARR_CURR() IF INT_FLAG THEN CALL cl_err('',9001,0) LET INT_FLAG = 0 IF p_cmd='u' THEN LET g_tc_omgl_ac.* = g_tc_omg_t.*

35、ELSE CALL g_tc_obk.deleteElement(l_ac) IF g_rec_b != 0 THEN LET g_action_choice = "detail" LET l_ac = l_ac_t END IF END IF CLOSE i535_bcl ROLLBACK WORK EXIT INPUT END IF LET l_ac_t = l_ac CLOSE i535_bcl COMMIT WORK ON ACTION CONTROLP #程序開(kāi)窗-INPUT模式 CASE WHEN INFIELD(tc_obk01) CALL cl_init_q

36、ry_var() LET g_qryparam.form ="q_occ" CALL cl_create_qry() RETURNING g_tc_obkl_ac.tc_obk01 DISPLAY BY NAME g_tc_obkl_ac.tc_obk01 NEXT FIELD tc_obk01 END CASE ON ACTION CONTROLO #沿用所有欄位 IF INFIELD(tc_omg01) AND l_ac > 1 THEN LET g_tc_omgl_ac.* = g_tc_omgl_ac-1.* NEXT FIELD tc_omg01 END I

37、F ON ACTION CONTROLZ CALL cl_show_req_fields() #顯現(xiàn)畫(huà)面上需要輸入?yún)s未輸入的所有字段 ON ACTION CONTROLG CALL cl_cmdask() #詢問(wèn)用戶欲執(zhí)行的程序,并執(zhí)行之 Ctlr + G ON ACTION CONTROLF # 欄位說(shuō)明 #截取當(dāng)前光標(biāo)停留在畫(huà)面上的字段位置 CALL cl_set_focus_form(ui.Interface.getRootNode() RETURNING g_fld_name,g_frm_name #Add on 040913 #顯示字段說(shuō)明 CALL cl_fldhelp(g_frm_name,g_fld_name,g_lang) #Add on 040913 ON IDLE g_idle_seconds #系統(tǒng)閑置時(shí)間 CALL cl_on_idle()

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論