• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

方便开发的工具之七

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: | 查看: 23次 | 进入软件测试论坛讨论

领测软件测试网
该程序是用于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 的文章,希望对照着看
能对大家有帮助

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网