/* * ----------------------------------------------------------------- * Execution of this macro requires a license for uni-XEDIT Extended * for each concurrent user of the macro. * ----------------------------------------------------------------- * * * * DBS.XEDIT * * The DBS.XEDIT macro performs a destructive backspace in a data line. * * Ideally this macro should be assigned to a PF key or CTL_key * combination by adding ONE of the following lines to your * .profile.xedit file. * * 'set pf# only macro dbs' * * where # is the number of the PF key assignment. * * 'set keyb ? command dbs' * * where ? is the CTL sequence desired for the key. You may wish to * replace the ? with whatever your terminal's backspace may be sending. * Note, however, that if your terminal's backspace key is being * translated by curses/terminfo, you'll have to choose some other key. * * Use the DBS.XEDIT macro by leaving the cursor after the character * to be deleted and pressing the appropriate key as discussed above. * */ "extract /cursor /curline" ln=cursor.3 /* line in file where cursor was */ c=cursor.4 /* column in that line where cursor was */ if ln=-1 then "emsg cursor not in a data line" else if c=1 then "emsg cursor at start of line" else do delta=curline.2-cursor.1 /* for repositioning at end */ ":"||ln /* make cursor line current */ "extract /curline" l=curline.3 /* get current line contents */ rt=length(l)-c+1 if rt>=0 then "replace" left(l,c-2) || right(l,rt) /* remove char */ delta /* back to original screen position */ "cursor file" ln c-1 /* move cursor backwards one character */ end