Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1298647
  • 博文数量: 287
  • 博客积分: 11000
  • 博客等级: 上将
  • 技术积分: 3833
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-16 08:43
文章分类
文章存档

2013年(15)

2012年(17)

2011年(17)

2010年(135)

2009年(85)

2008年(18)

分类: 系统运维

2010-06-21 09:26:06

QWCRTVCA - Retrieve Current Attributes
QWCCCJOB - Change Current Job
How to tell if the user pressed F3 when a command was running?
This is the code you can use to retrieve the F3/F12.

      d*-------------------------------------------------------------------------
      d*Parameters
      d*-------------------------------------------------------------------------
      d F3              s              1
      d F12             s              1

      d*-------------------------------------------------------------------------
      d*API QWCRTVCA
      d*-------------------------------------------------------------------------
      d** current attributes
      d ?a             ds
      d                                9b 0
      d**
      d                               16a
      d  cancel_key                    1
      d                                3
      d**
      d                               16a
      d  exit_key                      1
      d                                3
      d** current attributes length
      d ?a?           s              9b 0 inz(%len(?a))
      d** format name
      d ?afmt          s              8    inz('RTVC0100')
      d** no. of fields to return
      d ?aflds         s              9b 0 inz(2)
      d** keys fields to return
      d ?akey          ds
      d** ... cancel key
      d                                9b 0 inz(301)
      d** ... exit key
      d                                9b 0 inz(503)

      d*-------------------------------------------------------------------------
      d*API QWCCCJOB
      d*-------------------------------------------------------------------------
      d** reset keys
      d ?j             ds
      d                                9b 0 inz(2)
      d** ... reset cancel key
      d                                9b 0 inz(1)
      d                                9b 0 inz(1)
      d                                1    inz('0')
      d** ... reset job key
      d                                9b 0 inz(2)
      d                                9b 0 inz(1)
      d                                1    inz('0')

      d**---------------------------------------------------------------
      d*API error std
      d**---------------------------------------------------------------
      d ?pierror       ds
      d  ?r1                   1      4b 0 inz(8)
      d  ?r2                   5      8b 0 inz(0)

      c*****************************************************************
      c*MAINLINE
      c*****************************************************************
      c     *entry        plist
      c                   parm                    F3
      c                   parm                    F12
      c                   eval      F3 = *off
      c                   eval      F12 = *off

      c*-------------------------------------------------------------------------
      c*retrieve cancel/exit key
      c*-------------------------------------------------------------------------
      c                   call      'QWCRTVCA'
      c                   parm                    ?a
      c                   parm                    ?a?
      c                   parm                    ?afmt
      c                   parm                    ?aflds
      c                   parm                    ?akey
      c                   parm                    ?pierror

      c*-------------------------------------------------------------------------
      c*reset keys
      c*-------------------------------------------------------------------------
      c                   call      'QWCCCJOB'
      c                   parm                    ?j
      c                   parm                    ?pierror

      c*-------------------------------------------------------------------------
      c*return F3 or F12
      c*-------------------------------------------------------------------------
      c                   eval      F3 = exit_key
      c                   eval      F12 = cancel_key

      c                   return

Thanks to Beppe Costagliola
阅读(1410) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~