EDIT REXX execute FLIPFLOP EDIT REXX execute FLIPFLOP Author: David McRitchie formatted on 1995/04/01 06:54 for assistance contact: D. McRitchie DMcRitchie@hotmail.com -------------------------------------------------------------------------------- REXX execute NAME. FLIPFLOP users. PDF EDIT users type. Edit Macro resides in SYS1.TSOCLIST, and in IS03.SPF2.MACROS for use on SPF/PC -------------------------------------------------------------------------------- FLIPFLOP Reverse the cards vertically between two labels -------------------------------------------------------------------------------- related @ICOPY INVERT -------------------------------------------------------------------------------- FLIPFLOP will take a vertical stack of lines between two labels and reverse them vertically. -------------------------------------------------------------------------------- ISREDIT FLIPFLOP lptr-range|ENTIRE -------------------------------------------------------------------------------- lptr-range (required) A pair of line pointers is used to restrict the lines under consideration. The line pointers must be a labels. Specifying one line pointer is invalid. Al- though there is no default, you can specify .ZFIRST .ZLAST to indicate that all lines are to be processed. ENTIRE will be substituted by .ZFIRST .ZLAST Examples FLIPFLOP .A .B FLIPFLOP .A .ZL FLIPFLOP .ZF .B FLIPFLOP .ZF .ZL before ===> FLIPFLOP .A .B after ===> FLIPFLOP .A .B 000001 line 01 000001 line 01 .a line 02 .A line 06 000003 line 03 =NOTE= *BEGIN OF FLIPFLOP .A .B 000004 line 04 000003 line 05 000005 line 05 000004 line 04 .b line 06 000005 line 03 =NOTE= *END OF FLIPFLOP .A .B .B line 02 Internal Aspects Internal aspects describes how the REXX execute functions. This infor- mation is particularly useful to someone who may need to design a sim- ilarly functional REXX execute. It may also provide additional insight to the user. 1. A substitute label (.STA) is made up for the first label in case that label is .ZFIRST You may equate .STA to the first label. 2. The .STA label remains intact and lines from the bottom of the range will be pushed in front of the first label. Since lines are being added before the beginning label the line which gets saved, deleted, and pushed up is always the same line number (not the label). 3. The line whose number matches the line number of the original end of the label range (#LABL) will have a label (.OUT) assigned to it so that it can be saved, deleted, and the saved line copied before the .STA label. This step will be repeated until the line have reversed themselves. 4. Upon completion the original labels are reattached to their ori- ginal corresponding line numbers. .ZFIRST and .ZLAST labels are are not reattached though the results would be the same if it were a legal practice. 5. NOTELINES are placed to show that the FLIPFLOP has taken place. n FLIPFLOP on