Page 1 of 1

Own line commands

PostPosted: Fri May 02, 2014 1:54 pm
by LasseH
My "LINECMDS" program working just fine, BUT not for "block" commands

Every example I've found showing a test like this

if wordpos(lcmd,'CE RV LEF RIT') = 0 then


And the linecommand may be CEE-CEE or CE2, which ends up in "true"

My definition in 3.16 looks like this

                      ISPF EDIT Line Command Table  LINETBL  Row 11 to 13 of 13
 Command ===>                                                  Scroll ===> CSR 
                                                                Shift ===> PAGE
     User     MACRO    Program  Block    Multi    Dest                         
     Command           Macro    format   line     Used                         
     ----+--- ----+--- ----+--- ----+--- ----+--- ----+---                     
     CE       POSLINE  N        Y        Y        N                             
     RV       POSLINE  N        Y        Y        N                             


What I'm a doing wrong, anyone?
//Lasse

Re: Own line commands

PostPosted: Fri May 02, 2014 9:38 pm
by Pedro
Please elaborate on what you think is wrong.

I have not used the line command table. If you issue a block command that includes 10 lines, I think your program will get called 10 times, the same as if you issue your CE line command ten times. I am not sure if that is right or wrong, just my observation.

Re: Own line commands

PostPosted: Fri May 02, 2014 11:06 pm
by enrico-sorichetti
If you issue a block command that includes 10 lines, I think your program will get called 10 times,

NOPE ;) the program will be invoke just once

IIRC the sequence to be used for a command supporting multiple lines ( BLOCK COMMAND )

should be along the lines of

/* obtain C-range */
"PROCESS RANGE C"

/* check if a C-range exists */
IF rc = 0 THEN DO
"(ZFRANGE) = LINENUM .ZFRANGE"
"(ZLRANGE) = LINENUM .ZLRANGE"
end
...

as explained here

http://publib.boulder.ibm.com/infocente ... Macros.pdf

Re: Own line commands

PostPosted: Fri May 02, 2014 11:35 pm
by Pedro
I have not used the line command table.


I should learn to stay quiet for things I do not know. :-)

Re: Own line commands

PostPosted: Mon May 05, 2014 11:53 am
by LasseH
Pedro, that's what I thought to, but no...
Enrico, then the example on page 8 in the document won't work either
//Lasse

Re: Own line commands

PostPosted: Mon May 05, 2014 2:04 pm
by enrico-sorichetti
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

Re: Own line commands

PostPosted: Mon May 05, 2014 5:42 pm
by LasseH
Enrico, I'm getting the same results when using LMAC, it works.
So it doesn't seems to be transparent (work the same)
//Lasse

Re: Own line commands

PostPosted: Mon May 05, 2014 5:53 pm
by enrico-sorichetti
probably time to open a PMR with IBM

Re: Own line commands

PostPosted: Mon Jun 09, 2014 11:58 am
by LasseH
PMR 67826,130,846 opened
//Lasse