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) |