/* REXX -- EDITMEM -- edit membername found at cursor location */ /* EDITMEM ** CREATED BY D.MCRITCHIE 1991/05/06 "The REXX Macros Toolbox" */ /* REDONE IN REXX -- Feb 21, 1992 */ /* **USAGE WOULD BE TO SET UP A PFKEY SUCH AS 20 ===> EDITCOL1 */ /* place curson on the member name, and then hit PFK20 */ Address "ISREDIT" "MACRO (TOKEN)" "(MEMBERX) = MEMBER " memberx = strip(memberx,'t') "(DSNX) = DATASET" if token = "CHK" | token = "chk" then do; token = ''; chk=1; end; if token /= " " then do; line=token; signal gotone; end; "(ROW,COL) = CURSOR" if rc > 4 then exit IF COL = 0 THEN COL = 1 "(LINE) = line " ROW "(LABEL) = LABEL .ZCSR" if rc /= 0 then "LABEL .zcsr = .EDIT 0" if ROW = 0 then do ZEDSMSG = "EDITMEM cursor" ZEDLMSG="EDITMEM -- no name found, since cursor has not been placed" address "ISPEXEC" "SETMSG MSG(ISRZ001)" return 1 end from = COL /* in case cursor on a blank or something invalid */ do i = COL to 1 by -1; L=verify(substr(line,i,1),'1234567890abcdefghijklmnopqrstuvwxyz'||, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ@#$') if l /= 0 then leave from = i end line = translate(substr(line,from)) L=verify(line,'1234567890abcdefghijklmnopqrstuvwxyz'||, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ@#$') if l /=1 then line=substr(line,1,l-1) else do ZEDSMSG = "no name" ZEDLMSG = "EDITMEM did not find a name at line" ROW ', col ' COL address "ISPEXEC" "SETMSG MSG(ISRZ001)" return 1 end gotone: line = translate(line) ZEDSMSG = "EDITMEM "line ZEDLMSG = "EDITMEM edit macro invoked at cursor will EDIT "line address "ISPEXEC" "SETMSG MSG(ISRZ000)" if dsnx = "SCRIPT.EDFPRF30.TEXT" then do Address "TSO" "$EDIT SCRIPT.EDFLIB30.MACLIB("line")" return /* group intercepts if BookMaster Profile*/ end x = SYSDSN("'"||dsnx||"("||line||")'") if x /= "OK" then do /* even though ISREDIT EDIT would work -- make this fail*/ ZEDSMSG = "member" line "not found" ZEDLMSG = "EDITMEM failed to obtain "line "--" x address "ISPEXEC" "SETMSG MSG(ISRZ001)" if chk = 1 then return 0; else return 1 end if chk = 1 then do /* only want to verify that it exists */ ZEDSMSG = "member" line "exists" ZEDLMSG = "The member --" line "-- exists in the current directory" address "ISPEXEC" "SETMSG MSG(ISRZ001)" return 0 end address "ISPEXEC" "Control errors Return" "edit "line address "ISPEXEC" "Control errors cancel" lastcc = rc if lastcc /= 0 then do ZEDSMSG = "member" line "failed rc="lastcc line = translate(line) ZEDLMSG = "EDITMEM failed to obtain "line "--" x address "ISPEXEC" "SETMSG MSG(ISRZ001)" return 1 end