/* REXX -- INSERT characters before cursor */ /* Created by David McRitchie, "The REXX Macros Toolbox", 1992/01/17 */ /*********************************************************************/ /* options: */ /* WORD insert1 insert2 */ /* insert1 */ /* WORD :gt12. :egt12. */ /* :gt12. insert.insert.insert.xxx */ /*********************************************************************/ Address "ISREDIT" "MACRO (INSERT1,INSERT2)" "(LN,CL) = CURSOR" "(BND1,BND2) = BOUNDS" if left(insert1,1) = "'" then insert1a = substr(insert1,2,length(insert1)-2) else if left(insert1,1) = '"' then insert1a = substr(insert1,2,length(insert1)-2) else insert1a=insert1;insert1=insert1a if left(insert2,1) = "'" then insert2a = substr(insert2,2,length(insert2)-2) else if left(insert2,1) = '"' then insert2a = substr(insert2,2,length(insert2)-2) else insert2a=insert2;insert2=insert2a linex="" "f last p'^' .zcsr .zcsr" "(LNX,CL2) = CURSOR" "(LINE) = LINE " LN if bnd2 < (cl2 + length(insert1) + length(insert2)) then do "cursor = " ln cl ZEDSMSG = 'won''t fit' ZEDLMSG = "REQUEST to insert" insert1 "before, and " insert2 , 'after won''t fit' "LINE_AFTER .ZCSR = NOTELINE ""*ERROR**" ZEDLMSG """" ISPEXEC SETMSG MSG(ISRZ000) end if length(insert2) \= 0 then do linex = translate(line,' ',':,&^~|%^*_+=!ݼ;}{>