仿照aeci620实现单档开发
创建数据表 tc_lin_file
结构如图
创建画面cooi999
画面取aeci620进行修改
把画面的栏位的name名字改为数据表中的字段名 要一一对应
注意点:
第一个栏位有一个开窗,选择button edit 其余的是edit
开窗按钮
image 选项要选择zoom
action选项要选择 controlp
在全部更改完以后要调整栏位顺序
画面画完之后上传到coo/4fd中
然后编译
然后预览
发现报错 这个问题困扰了很久
报错原因是什么主机问题,不能xshell打开GDC
预览需要从前端GDC打开
方法:
1.进入p_zz
2.输入debug
3.更改运行指令
4.运行指令
5.完成预览
去p_perlang查看画的画面
发现可以查询到,在p_perlang进行维护字段说明,把繁体维护加上
至此,画面和表格结束
开始代码编写
代码用aeci620.4gl进行修改
主要是将aeci620中的数据库字段改成tc_lin_file中的字段
温馨提示:用查找加全部替换可以很快的改为代码
# Descriptions...: lj_单档员工测试
# Date & Author..: #C20211014-16548 by linjian
DATABASE ds
GLOBALS "../../../tiptop/config/top.global"
DEFINE g_tc_lin RECORD LIKE tc_lin_file.*
DEFINE g_tc_lin_t RECORD LIKE tc_lin_file.*
DEFINE g_tc_lin_o RECORD LIKE tc_lin_file.*
DEFINE g_tc_lin01_t LIKE tc_lin_file.tc_lin01
DEFINE g_wc,g_sql STRING
DEFINE g_d01 LIKE tod_file.tod08
DEFINE l_cmd LIKE type_file.chr1000
DEFINE g_row_count LIKE type_file.num10
DEFINE g_curs_index LIKE type_file.num10
DEFINE g_jump LIKE type_file.num10
DEFINE g_no_ask LIKE type_file.num5
DEFINE g_forupd_sql STRING
DEFINE g_before_input_done STRING
DEFINE g_chr LIKE type_file.chr1
DEFINE g_cnt LIKE type_file.num10
DEFINE g_i LIKE type_file.num5
DEFINE g_msg LIKE type_file.chr1000
DEFINE g_argv1 LIKE tc_lin_file.tc_lin01
DEFINE g_argv2 STRING
DEFINE g_u_flag LIKE type_file.chr1
MAIN
OPTIONS
INPUT NO WRAP
DEFER INTERRUPT
LET g_argv1 = ARG_VAL(1)
LET g_argv2 = ARG_VAL(2)
IF (NOT cl_user())
THEN
EXIT PROGRAM
END IF
WHENEVER ERROR
CALL cl_err_msg_log
IF (NOT cl_setup("COO"))
THEN
EXIT PROGRAM
END IF
CALL cl_used(g_prog,g_time,1) RETURNING g_time
INITIALIZE g_tc_lin.* TO NULL
INITIALIZE g_tc_lin_t.* TO NULL
INITIALIZE g_tc_lin_o.* TO NULL
LET g_forupd_sql = "SELECT * FROM tc_lin_file WHERE tc_lin01 = ? FOR UPDATE"
LET g_forupd_sql = cl_forupd_sql(g_forupd_sql)
DECLARE i999_cl CURSOR FROM g_forupd_sql
OPEN WINDOW i999_w WITH FORM "coo/42f/cooi999"
ATTRIBUTE (STYLE = g_win_style CLIPPED)
CALL cl_ui_init()
IF NOT cl_null(g_argv1) THEN
CASE g_argv2
WHEN "query"
LET g_action_choice = "query"
IF cl_chk_act_auth() THEN
CALL i999_q()
END IF
WHEN "insert"
LET g_action_choice = "insert"
IF cl_chk_act_auth() THEN
CALL i999_a()
END IF
OTHERWISE
CALL i999_q()
END CASE
END IF
LET g_action_choice=""
CALL i999_menu()
CLOSE WINDOW i999_w
CALL cl_used(g_prog,g_time,2) RETURNING g_time
END MAIN
FUNCTION i999_cs()
CLEAR FORM
INITIALIZE g_tc_lin.* TO NULL
IF g_argv1<>' ' THEN
LET g_wc=" tc_lin01='",g_argv1,"'"
ELSE
CONSTRUCT BY NAME g_wc ON
tc_lin01,tc_lin02,tc_lin03, tc_lin_genuser,
tc_lin_gengrup,tc_lin_genoriu,tc_lin_genorig,
tc_lin_genmodu,tc_lin_gendate,tc_lin_genacti
BEFORE CONSTRUCT
CALL cl_qbe_init()
ON ACTION controlp
CASE
WHEN INFIELD(tc_lin01)
CALL cl_init_qry_var()
LET g_qryparam.form = "cq_gen99"
LET g_qryparam.state = "c"
CALL cl_create_qry() RETURNING g_qryparam.multiret
DISPLAY g_qryparam.multiret TO tc_lin01
NEXT FIELD tc_lin01
OTHERWISE EXIT CASE
END CASE
ON IDLE g_idle_seconds
CALL cl_on_idle()
CONTINUE CONSTRUCT
ON ACTION about
CALL cl_about()
ON ACTION help
CALL cl_show_help()
ON ACTION controlg
CALL cl_cmdask()
ON ACTION qbe_select
CALL cl_qbe_select()
ON ACTION qbe_save
CALL cl_qbe_save()
END CONSTRUCT
END IF
LET