Try the attached macro. It does not require the character loop that the one provided by Phil does.

Tony Thigpen

Tony Thigpen wrote on 2/21/22 18:34:
If I understand your request, the XEDIT OVERLAY command is just backwards of what you want. It replaces the existing line with any character, other than a blank, found in the original 'copied line'.

This will take a little extra work. The original line needs to be saved, the copied line needs to replace it, then the original line needs to OVERLAY the now current line.

I have a PRFMERGE macro that I got somewhere that uses the standard overlay function. Let me see if I can reverse it's function.

Tony Thigpen

Binyamin Dissen wrote on 2/21/22 12:40:
On Mon, 21 Feb 2022 16:25:05 +0000 Rahim Azizarab
<000003f036d88eeb-dmarc-requ...@listserv.ua.edu> wrote:

:>In ISPF you would put X over the line numbers; and on the command line you would type  ==>   c ABC XYZ all X :>It results in changing all occurrences of ABC to XYZ on the lines marked by X only.

I am referring to the function where you type C on a line that has the overlay data and then OO/OO on the group of lines that you wish to overlay. The only
dependence on the data on the OO lines is that it will not replace a
non-blank.

:>    On Monday, February 21, 2022, 07:24:39 AM CST, Binyamin Dissen <bdis...@dissensoftware.com> wrote:
:>
:> What would the XEDIT equivalent to C OO/OO in ISPF which copies the marked
:>line, only overlaying blank characters the targeted lines?
:>
:>Sort of applying SET MASK to  a group of existing lines.

--
Binyamin Dissen <bdis...@dissensoftware.com>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
/*  prefix command - overlay two or more lines                      */
/*                                                                  */
/* you specify the overlay source line using 't' prefix command */
/* you specify the lines to be overlayed using 'ot' or 'ott'        */
/*                                                                  */
/* Unline the xedit command 'overlay', this prefix command will     */
/* only overlay blank positions in the destination lines            */
/*                                                                  */
/* to use this macro, add the following prefixes synonym to your    */
/* xedit profile:                                                   */
/*                                                                  */
/*       set prefix synonym t   prfmerge                            */
/*       set prefix synonym ot  m                                   */
/*       set prefix synonym ott mm                                  */
trace off
parse source . . . . . name .
arg pref func pline op extra
select
  when pref ¬= 'PREFIX'
    then call error1,
      'this macro must be invoked from the prefix area.'
  when func = 'CLEAR'
    then exit
  when func = 'SHADOW'
    then call error1,
      'invalid on shadow line.'
  when func ¬= 'SET'
    then call error1,
      'this macro must be invoked from the prefix area.'
  when extra ¬= ''
    then call error,
      "extraneous parameter '"strip(extra)"'."
  otherwise nop
end

'command extract /cursor/column'
if op = '' & cursor.4 > 0
  then op = cursor.4

'command extract /pending block oldname mm'
if pending.0 ¬= 0
  then do
    mm.1 = pending.1
    'command extract /pending block oldname mm :'mm.1+1'* /'
    if pending.0 ¬= 0
      then do
        mm.2 = pending.1
        mm.0 = mm.2-mm.1+ 1
        'command locate :'pline 'command extract /curline'
        baseline = curline.3
        'command locate :'mm.1
        do i = 1 to mm.0
          'command extract /curline'
          'replace' baseline
          'overlay' curline.3
          'next'
        end
        'command locate :'mm.1 'command set pending off'
        'command locate :'mm.2 'command set pending off'
        'command locate :'pline
      end
  end
  else do
    'command extract /pending oldname m/'
    if pending.0 ¬= 0
      then do
        if pending.5 ='' then pending.5 = 1
        'command locate :'pline 'command extract /curline'
        baseline = curline.3
        'command locate :'pending.1 'command extract /curline'
        'replace' baseline
        'overlay' curline.3
        'command set pending off'
        if pline < pending.1
          then pending.1 = pending.1 - pending.5
        'command locate :'pending.1 'command set pending off'
      end
      else
        'command locate :'pline 'command set pending on' name op
  end


'command cursor file' pline '1 priority 30'
exit

/* error routines */
error:
  'command locate :'pline
  'command set pending error' name||op||strip(extra)
error1:
  parse arg emsg
  'command emsg' emsg
  exit


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to