一、编译按钮功能
1、效果图
2、代码示例
FUNCTION p_link_rc2(p_ac)
DEFINE p_ac LIKE type_file.num5
DEFINE ch base.Channel
DEFINE l_cmdstr STRING
DEFINE dirhandle INTEGER
DEFINE l_list base.channel,
l_path STRING,
l_list_path STRING,
l_listr STRING
LET l_list_path = FGL_GETENV("TEMPDIR"),os.Path.separator(),"compile_msg"
LET l_list = base.channel.create()
CALL l_list.setdelimiter("")
CALL l_list.openfile(l_list_path CLIPPED, "w" )
LET l_path = FGL_GETENV(g_gal[p_ac].gal02),os.Path.separator(),"4gl"
CALL os.Path.chDir(l_path) RETURNING dirhandle
LET ch = base.Channel.create()
LET l_cmdstr = "r.c2 ",g_gal[p_ac].gal03
CALL ch.openPipe(l_cmdstr,"r")
WHILE TRUE
LET l_listr = ch.readLine()
CALL l_list.write(l_listr)
IF ch.isEof() THEN
EXIT WHILE
END IF
DISPLAY l_listr
END WHILE
CALL ch.close()
LET l_cmdstr=FGL_GETENV("FGLRUN") ," ",FGL_GETENV("TOP"),os.Path.separator(),"azz",os.Path.separator(),
"42r",os.Path.separator(),"p_view.42r ",os.Path.join(FGL_GETENV("TEMPDIR"),"compile_msg")," 66"
RUN l_cmdstr
IF os.Path.exists(os.Path.join(FGL_GETENV("TEMPDIR"),"compile_msg")) THEN
LET l_cmdstr = "rm ",os.Path.join(FGL_GETENV("TEMPDIR"),"compile_msg")
RUN l_cmdstr
END IF
END FUNCTION
二、链接按钮功能代码
1、效果图
2、代码示例
FUNCTION p_link_rl2()
DEFINE ch base.Channel
DEFINE l_cmdstr STRING
DEFINE l_list base.channel,
l_list_path STRING,
l_listr STRING
LET l_list_path = FGL_GETENV("TEMPDIR"),os.Path.separator(),"link_msg"
LET l_list = base.channel.create()
CALL l_list.setdelimiter("")
CALL l_list.openfile(l_list_path CLIPPED, "w" )
LET ch = base.Channel.create()
LET l_cmdstr = "r.l2 ",g_gak.gak01
CALL ch.openPipe(l_cmdstr,"r")
WHILE TRUE
LET l_listr = ch.readLine()
CALL l_list.write(l_listr)
IF ch.isEof() THEN
EXIT WHILE
END IF
DISPLAY l_listr
END WHILE
CALL ch.close()
LET l_cmdstr=FGL_GETENV("FGLRUN") ," ",FGL_GETENV("TOP"),os.Path.separator(),"azz",os.Path.separator(),
"42r",os.Path.separator(),"p_view.42r ",os.Path.join(FGL_GETENV("TEMPDIR"),"link_msg")," 66"
RUN l_cmdstr
IF os.Path.exists(os.Path.join(FGL_GETENV("TEMPDIR"),"link_msg")) THEN
LET l_cmdstr = "rm ",os.Path.join(FGL_GETENV("TEMPDIR"),"link_msg")
RUN l_cmdstr
END IF
END FUNCTION