使用T100,在menu界面和Ctrl+G功能时,可以只输入部分字符或中文就可以将匹配的程序全部列出来供选择而TOP GP暂时还不支持这个功能
贴代码 #------------------------- #实现程序模糊查询功能 #------------------------- FUNCTION udmtree_getcmdrun(ps_cmd_line) DEFINE ps_cmd_line LIKE type_file.chr1000 DEFINE l_cnt LIKE type_file.num5 DEFINE ls_were LIKE type_file.chr1000 DEFINE l_sql STRING LET l_cnt = 0 SELECT count(gaz01) INTO l_cnt FROM gaz_file,zz_file WHERE zz01 = gaz01 AND gaz02 = '2' AND zz011 <> 'MENU' AND gaz01 =ps_cmd_line IF cl_null(l_cnt) THEN LET l_cnt = 0 END IF # IF l_cnt >0 THEN RETURN ps_cmd_line ELSE LET l_sql =" SELECT count(gaz01) FROM gaz_file,zz_file ", " WHERE zz01 = gaz01 AND gaz02 = '",g_lang,"' AND zz011 <> 'MENU' ", " AND (gaz01 LIKE '%",ps_cmd_line,"%' OR gaz03 LIKE '%",ps_cmd_line,"%') " PREPARE q002_cus102 FROM l_sql EXECUTE q002_cus102 INTO l_cnt IF cl_null(l_cnt) THEN LET l_cnt = 0 END IF # IF l_cnt = 0 THEN RETURN ps_cmd_line END IF END IF CALL cl_init_qry_var() LET g_qryparam.form = "q_gaz" LET g_qryparam.state = "i" LET g_qryparam.CONSTRUCT = 'N' LET g_qryparam.arg1 = g_lang LET g_qryparam.where = " gaz01 LIKE '%",ps_cmd_line,"%' OR gaz03 LIKE '%",ps_cmd_line,"%' " CALL cl_create_qry() RETURNING g_qryparam.multiret IF NOT cl_null(g_qryparam.multiret) THEN LET ps_cmd_line = g_qryparam.multiret END IF RETURN ps_cmd_line END FUNCTION 使用方式: 在程序调用cl_cmdrun((ls_cmd_line) 之前,调用上面这个函数即可 # by caozq CALL udmtree_getcmdrun(ls_cmd_line) RETURNING ls_cmd_line # by caozq 同理,在Ctrol+G 调用cl_cmdask()这个函数的时候加入这一段,也可实现模糊查询功能 |
|
沙发#
发布于:2018-06-25 11:42
受教了。
|
|
板凳#
发布于:2018-07-18 20:00
支持分享
|
|
地板#
发布于:2018-11-19 12:06
扛扛搭
|
|
4楼#
发布于:2019-09-06 19:30
感谢楼主分享!!!
|
|
5楼#
发布于:2020-06-19 22:12
get新技能
|
|
6楼#
发布于:2022-03-03 14:30
牛人喔
|
|
7楼#
发布于:2023-03-26 13:35
可以改造一下,支持多个关键字查询,对了。不要加在cmdrun上面一行,不然财务程序会bug但是不影响用
|
|