/*rexx*/ address "ISREDIT";"macro" /*********************************************************************/ /* David McRitchie, "The REXX Macros Toolbox", 1997/06/16 Mon */ /* TAG -- Create begin tag and end tag around word at CURSOR */ /* Related macros: HTMLHYP */ /* word located at the cursor. User supplies the tag */ /*********************************************************************/ parse arg tags tagsx = translate(tags," ",">") "(row,col) = cursor" /* wwwww abc */ "line_before 2 = Noteline (tags)" endtag="" begtag = "<"word(tags,1)">" do i=length(tags) to 1 by -1 if substr(tags,i,1) = "<" then do endtag = endtag"" end end if endtag = "" then endtag = "" else begtag = tags "(line) = line" row oline = line line = translate(line," ","+%^&*()_+={}[]|\:;""'<>,.?/")||" " i = index(substr(line,col)," ") - 1 k=col do j = col to 1 by -1 if " " = substr(line,j,1) then leave; k=j end; wordd = substr(line,k,col-j+i-1) line = substr(oline,1,k-1)||begtag||wordd||endtag||, substr(oline,K-1+col-j+i) "cursor =" row col "LINE .zcsr = (line)" row = row + 1 /* prepare to place cursor for next line */ "cursor =" row col exit