tested using the old LMAC
but according to the manuals it should not make any difference
( note how the PROCESS RANGE construct takes care automagically
of a single line selection )
the macro
EDIT ENRICO.ISPF.EXEC(LINEMAC) - 01.05 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /* */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace "O"
000005
000006 Parse Source _sys _how _cmd .
000007
000008 _ack = 0
000009 _ack = 1
000010
000011 If ( Sysvar(SYSISPF) \= "ACTIVE" ) Then Do
000012 Say left(_cmd,8)"- Ispf is not active. Command not executed"
000013 exit 4
000014 End
000015
000016 call $ispex "CONTROL ERRORS RETURN "
000017
000018 if ( $isred("MACRO (LCMD) NOPROCESS ") \= 0 ) then do
000019 zedsmsg = "Invocation ERROR"
000020 zedlmsg = left(_cmd,8)"- Must be invoked as a MACRO"
000021 call $ispex "SETMSG MSG(ISRZ001)"
000022 exit 4
000023 end
000024
000025 if ( $isred("PROCESS RANGE " lcmd ) \= 0 ) then do
000026 call $ispex "SETMSG MSG(ISRZ002) "
000027 exit 8
000028 end
000029
000030 call $isred "(XFRANGE) = LINENUM .ZFRANGE "
000031 call $isred "(XLRANGE) = LINENUM .ZLRANGE "
000032
000033 xvars = rxvars()
000034 do i = 1 to words(xvars)
000035 v = word(xvars, i)
000036 say left(v,12) value(v)
000037 end
000038
000039 If ( _ack = 1 ) then do
000040 zedsmsg = left(_cmd,8)"- Ended"
000041 zedlmsg = left(_cmd,8)"- Ended"
000042 call $ispex "SETMSG MSG(ISRZ001) "
000043 end
000044
000045 Exit 0
000046
000047 /* */
000048 $tsoex:
000049 tso_0tr = trace("O")
000050 Address TSO arg(1)
000051 tso_0rc = rc
000052 trace value(tso_0tr)
000053 return tso_0rc
000054
000055 /* */
000056 $ispex:
000057 isp_tr = trace("O")
000058 Address ISPEXEC arg(1)
000059 isp_rc = rc
000060 trace value(isp_tr)
000061 return isp_rc
000062
000063 /* */
000064 $isred:
000065 isr_tr = trace("O")
000066 Address ISREDIT arg(1)
000067 isr_rc = rc
000068 trace value(isr_tr)
000069 return isr_rc
000070
****** **************************** Bottom of Data ****************************
the BLOCK command
the command is Z, doubled to ZZ to make it a block command
000060 trace value(isp_tr)
000061 return isp_rc
000062
000063 /* */
ZZ0064 $isred:
000065 isr_tr = trace("O")
000066 Address ISREDIT arg(1)
000067 isr_rc = rc
000068 trace value(isr_tr)
00ZZ69 return isr_rc
000070
****** **************************** Bottom of Data ****************************
the content of the variables
_ACK 1
_CMD LINEMAC
_HOW COMMAND
_SYS TSO
ISP_RC 0
ISP_TR O
ISR_RC 0
ISR_TR O
LCMD Z
RC 0
RESULT 0
SIGL 31
XFRANGE 00000064
XLRANGE 00000069
***
the SINGLE line command
the command is a single Y
000060 trace value(isp_tr)
000061 return isp_rc
000062
000063 /* */
000064 $isred:
000065 isr_tr = trace("O")
0y0066 Address ISREDIT arg(1)
000067 isr_rc = rc
000068 trace value(isr_tr)
000069 return isr_rc
000070
****** **************************** Bottom of Data ****************************
the content of the variables
_ACK 1
_CMD LINEMAC
_HOW COMMAND
_SYS TSO
ISP_RC 0
ISP_TR O
ISR_RC 0
ISR_TR O
LCMD Y
RC 0
RESULT 0
SIGL 31
XFRANGE 00000066
XLRANGE 00000066
***
here is the BLOCK command ( with a repetition count )
the command is a W3
000060 trace value(isp_tr)
000061 return isp_rc
000062
000063 /* */
000064 $isred:
000065 isr_tr = trace("O")
000066 Address ISREDIT arg(1)
w30067 isr_rc = rc
000068 trace value(isr_tr)
000069 return isr_rc
000070
****** **************************** Bottom of Data ****************************
the content of the variables
_ACK 1
_CMD LINEMAC
_HOW COMMAND
_SYS TSO
ISP_RC 0
ISP_TR O
ISR_RC 0
ISR_TR O
LCMD W
RC 0
RESULT 0
SIGL 31
XFRANGE 00000067
XLRANGE 00000069
***
-- edited to add the repletion count test