TOPGP5.3:p_link增加编译、链接功能

一、编译按钮功能

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值