/*rexx*/ /* David McRitchie -- "The REXX Macros Toolbox" -- 1997/05/10 */ /* Has been PUT into Toolbox but MUST BE CUSOMIZED by user */ address "ISREDIT";"MACRO" parse arg filename help . parse var filename filename "." ext help=translate(help) if filename = "" then do /* code from @EDIT to edit membername at CURSOR if none specified*/ "(row,col) = cursor" "(line) = line .zcsr" do i = COL to 1 by -1; L=verify(substr(line,i,1),'1234567890abcdefghijklmnopqrstuvwxyz'||, '_-ABCDEFGHIJKLMNOPQRSTUVWXYZ@#$().\:') if l \= 0 then leave from = i end line = STRIP(substr(line,from)) L=verify(line,'1234567890abcdefghijklmnopqrstuvwxyz'||, '_-ABCDEFGHIJKLMNOPQRSTUVWXYZ@#$.*%\:') if l >0 then do line=substr(line,1,l-1) if substr(line,l-1,1) = '.' then line=substr(line,1,l-2) end else if l <> 0 then do; /* spfpc would not accept null then */ ZEDSMSG = "no name" ZEDLMSG = "Did not find a name at line" ROW ', col ' COL address "ISPEXEC" "SETMSG MSG(ISRZ001)" return 1 end filename = line address "CMD" "SPFPC" "/b"||"d:\spfmacro\"filename".spf /e" line = " spfedit d:\spfmacro\"filename".spf RC="rc "line_before" row "= noteline (line)" row = row + 1 "cursor =" row col exit end if "HELP" = help then do address "CMD" "SPFPC" "/b"||"d:\website\rexx01\txt\"filename".txt /e" exit end if help = "HTM" then do address "CMD" "SPFPC" "d:\website\dmcrit~1\htm\"filename".htm /e" exit end if help = "TXT" then do address "CMD" "SPFPC" "d:\website\rexx01\txt\"filename".txt /e" exit end if help = "TSO" then do address "CMD" "SPFPC" "d:\website\rexx02\tsopdf\"filename".txt /e" exit end if help = "COPY" then do address "CMD" "SPFPC" "d:\webcopy\rexx03\spfpc\"filename".spf /e" exit end if help = "BAT" then do address "CMD" "SPFPC" "d:\goodies\"filename".bat /e" exit end if help = "WEB" then do address "CMD" "SPFPC" "d:\website\rexx03\spfpc\"filename".spf /e" exit end if help = "EXCEL" then do address "CMD" "SPFPC" "d:\website\dmcrit~1\excel\"filename".htm /e" exit end Address "CMD" "SPFPC" "d:\spfmacro\"filename||".spf /e" exit /* $macro.bat: if not a%1==a%2 spfpc d:\spfmacro\%1%.spf /e */ "(member) = member" "(row,col) = cursor" if row = 0 | col = 0 then do ZEDSMSG = "CURSOR" ZEDLMSG = "CURSOR has not been positioned on a line at a member" address "ISPEXEC" "SETMSG MSG(ISRZ001)" return 0 end "(line) = line .zcsr" line = translate(line) arg col1 col2 if col2 <> " " then do line = name(line,col1,col2) from = col1 /* readjust cursor */ signal gotone end /* c:\spfmacro\nxnx.spf */ gotone: parse version v1 v2 v3 v4 v5 if v1 = "REXXSAA" then Address "CMD" "CALL" "SPF2" line "/E" if v1 = "REXX/2" then /* note CALL only in OS/2 */ Address "CMD" "c:\spfpc40\SPFPC.exe" line "/E" row = row + 1 "cursor =" row from exit rc name: procedure; /* N -- nwork */ /* copied from REFORMAT.spf to add functionality to @EDIT.spf */ /* reconstruct name.ext from dir listing name ext */ /* preserving original area occupied by column pair */ arg str1,from,length FL = length - from + 1 B=0 str1 = strip(substr(str1,from,length),"b") nstr1="" do i = 1 to length(str1) if substr(str1,i,1) <> " " then do; b=0 nstr1 = nstr1||substr(str1,i,1) end else do if b = 0 then nstr1 = nstr1"." b=b+1 end end nstr = left(nstr1,length) return nstr