chaat
Sophomore Member
Posts: 59
|
Post by chaat on Oct 22, 2014 1:54:14 GMT -5
George, I have a command string that I use to box comments in cobol code between two labels .A and .B as follows.
c p'==' '* ' 7 72 all .a .a; c ' ' '*' all 7 .a .b; c ' ' '*' 71 all .a .b; c p'==' '* ' 7 72 all .b .b;reset label;reset
when i have the MINLEN set to 0 this does not change the lines beyond the last character in each line.
to fix that I'm trying to use the PLL block commands but i'm not sure how to map line commands to a key. on the mainframe a ":" is used to designate a line command. So i'm attempting to L(ocate) the .a label, enter a PLL80, L(ocate) the .b label and then enter a PLL command to pad the lines before entering the rest of the change commands.
another option would be to add TRIM / PAD primary commands.
something like PAD 80 ALL .A .B or PAD 80 ALL X or PAD 80 ALL
===> here is the command string i was attempting to use. i'm not sure if i would need to issue and (enter) keyboard primitive after the second line command. if we had a PAD primary command this would be pretty easy.
L .A; :PLL72; L .B; PLL;c p'==' '* ' 7 72 all .a .a; c ' ' '*' all 7 .a .b; c ' ' '*' 71 all .a .b; c p'==' '* ' 7 72 all .b .b;reset label;reset
|
|
|
Post by George on Oct 22, 2014 10:50:18 GMT -5
chaat: An ideal candidate for a macro.
I've had a box macro since forever, right back to a REXX ISPF version.
I stripped out some extraneous stuff from my current one, here's a basic version you can easily tweak to your specific preferences. It is used by just putting BXX / BXX line commands on the range of lines to be 'boxed'. Left/Right column boundaries are set internally, as is the format of the actual box text. Just store it in your SPFLite\Macros\ folder. If you're like me, you'll end up with several minor variations, one for COBOL, one for JCL, one for Assembler, etc. I found that simpler than building the different variations of the box into the macro itself.
George
' BX.MACRO ' BX - Draw box around a range of lines ' Syntax: BXX BXX commands on a pair of lines ' Two line command operands ' Author: George Deluca ' if is_primary_Cmd then halt(fail, "BX macro was not invoked as a line command") dim lm as number = 7 ' Box left column dim rm as number = 72 ' Box right column dim lno1 as number = Get_Src1_Lptr ' From line dim lno2 as number = Get_Src2_Lptr ' To line dim i as number = 0 ' dim hline1, hline2 as string ' Overlay lines
hline1 = repeat$(rm - 1, "-") + "+" ' Build top/bottom line mid$(hline1, 1) = repeat$(lm - 1, " ") + "+" '
hline2 = repeat$(rm - 1, " ") + "|" ' Build inner lines mid$(hline2, 1) = repeat$(lm - 1, " ") + "|" '
' Insert top line SPF_Cmd("ADD", $DQ + hline1 + $DQ, "!" + format$(lno1 - 1))
' Overlay existing lines for i = lno1 + 1 to lno2 + 1 ' Set # lines to do if Is_Data(i) then ' Only data lines SPF_Ovr(i, 1, hline2) ' Overlay the box chars end if ' next '
' Insert bottom line SPF_Cmd("ADD", $DQ + hline1 + $DQ, "!" + format$(lno2 + 1)) Set_Csr(lno2 + 3, 0, 0) ' Put cursor on next line halt ' Done
|
|