中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 操作系统 > IBM Server
方便开发的工具之七
作者:未知 时间:2005-09-13 15:50 出处:ChinaUnix.net 责编:chinaitpower
              摘要:方便开发的工具之七

该程序是用于SOURCE的注释功能,在代码行中按下F7在注释和非注释行之间进行切换.

添加方式如图所示:

代码如下:

     H**********************************************************************
     H*        RPGLE - SEUCMT  - ADD COMMENT IN SEU                        *
     H*                                                                    *
     H*    COPYRIGHT (C) 2005 YAO ZHONGGUANG.  ALL RIGHTS RESERVED.        *
     H**********************************************************************
     H DATEDIT(*YMD)
     H TIMFMT(*HMS)
      **********************************************************************
      *    DEFINITION SPECIFICATIONS
      **********************************************************************
      **********************************************************************
      * Entry Parameters declarations
      **********************************************************************
     D ParmSeuInput    S               *
     D ParmSeuOut      S               *
     D ParmSeuLine     S               *
      **********************************************************************
      * Header information
      **********************************************************************
     D HeaderInfo      DS                  BASED(ParmSeuInput)
     D  RecLength              1      4B 0
     D  CursorRRN              5      8B 0
     D  CursorPos              9     12B 0
     D  CCSID                 13     16B 0
     D  InRecords             17     20B 0
     D  MemberName            21     30
     D  FileName              31     40
     D  LibraryName           41     50
     D  MemberType            51     60
     D  CmdKey                61     61
     D  Mode                  62     62
     D  SplitSess             63     63
     D  Res                   64     64
      **********************************************************************
      * Return Codes
      **********************************************************************
     D ReturnInfo      DS                  BASED(ParmSeuOut)
     D  RetCode                1      1
     D  Res2                   2      4
     D  OutRecords             5      8B 0
     D  InsertSeq              9     15
     D  Res3                  16     37
      **********************************************************************
      * Line Command and Text
      **********************************************************************
     D LineInfo        DS                  BASED(ParmSeuLine)
     D  LineCmd                       7
     D  LineRetCode                   1
     D  SourceSeq                     6
     D  SourceDate                    6
     D  SourceStmt                  256
      **********************************************************************
      * Send message API
      **********************************************************************
     D SndPgmMsg       PR                  ExtPgm('QMHSNDPM')
     D  MsgID                         7    Const
     D  MsgFile                      20    Const
     D  MsgData                     256    Const
     D  MsgDataLen                   10i 0 Const
     D  MsgType                      10    Const
     D  MsgStackEnt                  10    Const
     D  MsgStackCnt                  10i 0 Const
     D  MsgKey                        4    Const
     D  MsgAPIError                        like(APIError)
      **********************************************************************
      * API error structure
      **********************************************************************
     D APIError        DS                  inz
     D  ErrSSize                     10i 0 inz(%len(APIError))
     D  ErrSUse                      10i 0
     D  ErrSMsgID                     7
     D  ErrSResrv                     1
     D  ErrSData                     80
      **********************************************************************
      * Work Variables
      **********************************************************************
     D wMsgID          S              7
     D wSource         S            256    Varying
     D wPos            S              3S 0
     D wSourceLen      S             10i 0
     D wBlankLine      S                   Like(LineCmd)
     D wFirstLine      S               *
     D wWorkLine       S               *
      **********************************************************************
      *    Work Const
      **********************************************************************
     D wCmtS           C                   Const('/*')
     D wCmtE           C                   Const('*/')
      **********************************************************************
      *    CALCULATION SPECIFICATIONS
      **********************************************************************
      *
     C     *Entry        Plist
     C                   Parm                    ParmSeuInput
     C                   Parm                    ParmSeuOut
     C                   Parm                    ParmSeuLine
      *
      **********************************************************************
      *    M A I N - R O U T I N E
      **********************************************************************
     C*
     C* Update Mode
     C                   If        Mode = 'U'
     C*
     C     CmdKey        CasNE     '0'           SubLineKey
     C                   Endcs
     C*
     C                   Else
     C* Browse Mode
     C                   Eval      RetCode = '1'
     C                   Eval      wMsgID  = 'EDT1202'
     C                   Exsr      SubSndMsg
     C*
     C                   Endif
     C* Return
     C                   Eval      *InLr = *On
     C                   Eval      *InRt = *On
     C*
      **********************************************************************
      *
      **********************************************************************
     C     SubLineKey    Begsr
     C*
     C                   If        CmdKey    = '7'
     C*
     C                   If        CursorPos = 0
     C                   Eval      RetCode   = '1'
     C                   Eval      wMsgID    = 'EDT2010'
     C                   Exsr      SubSndMsg
     C                   Else
     C                   Exsr      SubSltType
     C                   Endif
     C*
     C                   Else
     C*
     C                   Eval      RetCode   = '1'
     C                   Eval      wMsgID    = 'EDT0001'
     C                   Exsr      SubSndMsg
     C*
     C                   Endif
     C*
     C                   Endsr
      **********************************************************************
      *
      **********************************************************************
     C     SubSltType    Begsr
     C*
     C                   Select
     C*
     C                   When      %Subst(MemberType:1:3) = 'CLP'
     C                   Exsr      SubClpCmt
     C                   When      %Subst(MemberType:1:3) = 'RPG'  Or
     C                             %Subst(MemberType:4:3) = 'RPG'  Or
     C                             %Subst(MemberType:1:2) = 'PF'   Or
     C                             %Subst(MemberType:1:2) = 'LF'   Or
     C                             %Subst(MemberType:1:4) = 'DSPF' Or
     C                             %Subst(MemberType:1:4) = 'PRTF'
     C                   Exsr      SubRpgCmt
     C*
     C                   Endsl
     C*
     C                   Endsr
      **********************************************************************
      *
      **********************************************************************
     C     SubClpCmt     Begsr
     C*
     C                   Eval      SourceStmt = %Subst(SourceStmt:1:RecLength)
     C                   Eval      %Len(wSource) = RecLength
     C                   Eval      wSource = %Trim(SourceStmt)
     C*
     C                   If        wSource = *Blanks
     C                   Eval      RetCode = '1'
     C                   Goto      SubClpCmtEnd
     C                   Endif
     C*
     C* Remove Comment
     C                   If        %Subst(wSource:1:2) = wCmtS
     C*
     C                   Eval      wPos = %Scan(wCmtS:SourceStmt)
     C                   Eval      %Subst(SourceStmt:wPos:2) = '  '
     C                   Eval      wPos = %Scan(wCmtE:SourceStmt)
     C                   Eval      %Subst(SourceStmt:wPos:2) = '  '
     C* Add Comment
     C                   Else
     C*
     C                   Eval      wSource = wCmtS
     C                                     + ' '
     C                                     + %Trim(wSource)
     C                                     + ' '
     C                                     + wCmtE
     C*
     C     ' '           Check     SourceStmt    wPos
     C*
     C                   If        wPos < 4
     C                   Eval      SourceStmt = wSource
     C                   Else
     C                   Eval      SourceStmt = *Blanks
     C                   Eval      %Subst(SourceStmt:wPos-3) = wSource
     C                   Endif
     C*
     C                   Endif
     C*
     C                   Exsr      SubUpd
     C*
     C     SubClpCmtEnd  Endsr
      **********************************************************************
      *
      **********************************************************************
     C     SubRpgCmt     Begsr
     C*
     C                   If        %Subst(SourceStmt:7:1) = '*'
     C                   EVAL      %Subst(SourceStmt:7:1) = ' '
     C                   Else
     C                   EVAL      %Subst(SourceStmt:7:1) = '*'
     C                   Endif
     C*
     C                   Exsr      SubUpd
     C*
     C                   Endsr
      **********************************************************************
      *
      **********************************************************************
     C     SubSndMsg     Begsr
     C*
     C                   Callp     SndPgmMsg(wMsgID:
     C                                       'QEDTMSG   QPDA      ':
     C                                       *Blanks:
     C                                       *Zero:
     C                                       '*INFO':
     C                                       '*':
     C                                       2:
     C                                       *Blanks:
     C                                       APIError)
     C*
     C                   Endsr
      **********************************************************************
      *
      **********************************************************************
     C     SubUpd        Begsr
     C*
     C                   Eval      Retcode = '0'
     C                   Eval      OutRecords = 1
     C*
     C                   Endsr






 michael9406 回复于:2005-03-25 15:53:51
可否请大侠讲一下原理。

 coolk 回复于:2005-03-25 18:36:13
^_^  好厉害!

我也想知道原理!

 ibmas400 回复于:2005-03-26 00:34:45
这个帖子有水准、设为精华不为过。。。

 xuguopeng 回复于:2005-03-26 09:11:09
[quote:075b76acf0="michael9406"]可否请大侠讲一下原理。[/quote:075b76acf0]

恩~  :m01:  说说原理嘛 :em06:  :em06:

 ewmiscc 回复于:2005-03-26 09:31:11
真的没注意到这个地方有个exit program.

 fpoise 回复于:2005-03-26 11:06:19
恩~    说说原理嘛

 60133056 回复于:2005-03-26 12:09:46
关注中

 YZG 回复于:2005-03-26 12:29:11
原理就是接受三个指针参数,进行处理后返回相应的参数即可.

 lijunjun237 回复于:2005-04-21 11:00:50
what is this?

 lijunjun237 回复于:2005-04-21 11:00:50
what is this?

 layyf 回复于:2005-04-21 15:48:04
which version does the program for?
I can't find the 'change session default' command in my system. Why?

 守夜人 回复于:2005-05-30 15:34:40
唉,天书啊,真不知道大吓们是怎么学的???

 tomroom 回复于:2005-06-03 15:54:47
程序里注释太少了,根本看不懂

 Eagle_wolf 回复于:2005-06-03 17:46:31
关键是exit program 提供的那三个参数的结构没有说明,有说明就好看多了!

 Eagle_wolf 回复于:2005-06-03 19:12:22
http://www.douzhe.com/docs/bbsjh/5/3930.html
这里也有一个关于增加seu line command 的文章,希望对照着看
能对大家有帮助

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有