/* SYSOUT TRAP -- OS/2 & DOS version not for MVS -- REXX */ /* Author: David McRitchie, "The REXX Macros Toolbox", 1994/03/10 */ Address "ISREDIT";"MACRO (CMD)" line = "/"||"*--" date() time() "-- @STRAP" cmd "--*"||"/" "line_after .zl = dataline (line)" if cmd="" then do ZEDSMSG = "No Cmd" ZEDLMSG = "@STRAP -- command is missing. e.g. @STRAP dir a: " "ISPEXEC" "SETMSG" "MSG(ISRZ001)" /* 1 is alarm */ "line_before .zf = noteline (zedlmsg)" return 4 end /************ code added to work on SPF/PC without OS/2 */ parse version v1 v2 v3 v4 v5 if v1 = "REXX/2" then do /* rxqueue not available*/ Address "CMD" cmd "> c:\temp\strp1.tmp" rcx = rc if rcx <> 0 then "line_after .zl = dataline """rc="rc""" "copy after .zl c:\temp\strp1.tmp" if rc = 0 then address "CMD" "del c:\temp\strp1.tmp" return 0 end /************ code when using OS/2 should run quicker*/ Address "CMD" cmd "| rxqueue" say rxqueue do i = 1 by 1 until queued() = 0 parse pull line "line_after .zl = dataline (line)" end return 0 /*********************************************************************/ /* examples: */ /* @strap dir @S*.* */ /*********************************************************************/ /* @SEND SPF 1754 05/10/97 9:18a */ /* @SEQ SPF 9045 05/10/97 9:18a */ /* @SAVE SPF 860 05/10/97 9:18a */ /* @SMALLS SPF 18274 05/10/97 9:18a */ /* @STRAP SPF 1385 05/24/97 2:55p */ /*********************************************************************/ /* @strap dir @s*.* /b */ /*********************************************************************/ /* @SEND.SPF */ /* @SEQ.SPF */ /* @SAVE.SPF */ /* @SMALLS.SPF */ /* @STRAP.SPF */ /*********************************************************************/ /* The following command is being prevented somehow by SPF/PC */ /* @STRAP dir @s*.* /n /on -- because of the /n */ /* DOS dir @s*.* /n /on -- because of the /n */