/*********************************************************************** MACRO: @PRINT -- dataset currently being edited by SPF This is @PRINT.SFP orig. C:\SPF2\@PRINT.SPF People w/o SPF may use.. C:\SPF2\PUNT.CMD wanted to use @PRINT.CMD but the @ means something special. PURPOSE: interface to 4029out ***********************************************************************/ /* Macro to print current file to LPT2 */ 'ISREDIT MACRO(PARMS)' trace off /* Get rid of previous error lines */ 'ISREDIT RESET SPECIAL' /* If source has not been saved, save it */ 'ISREDIT (modified) = DATA_CHANGED' if (modified=YES) then 'ISREDIT SAVE' /* Retrieve filename information about source file */ 'ISREDIT (filename) = DATASET' filename = TRANSLATE(filename) switches = '/d:LPT2 /ml:1 /mr:.50 /mt:.45 /mb:.40' /* Get the length of the longest line in filename*/ L = 0; Call Stream FileName, "Command", "Open read"; If Result \= "READY:" then do; Say "Output '"FileName"' open returned '"Result"'"; Signal InnerError; End; Do forever; X = LineIn(FileName); RC = Stream(FileName, "Description"); Select; When RC = "READY:" then NOp; When RC = "NOTREADY:EOF" then Leave; Otherwise do; Call InputError RC; Signal InnerError; exit End; End; IF Length(X) > L THEN L = Length(X); End Call Stream FileName, "Command", "Close"; If Result \= "READY:" then do; Say "Output '"FileName"' close returned '"Result"'"; Signal InnerError; End; Address CMD '4029out /c:'L switches filename /* 4029out may be installed in C:\is02\4029out */ ZEDSMSG = "@PRINT RC="RC", L="L ZEDLMSG = "@PRINT RC="RC", longest line="L"," printed filename 'ISPEXEC SETMSG MSG(ISRZ000)' Exit 0; InputErrox: Procedure expose ReturnCode I FileName; Arg RC; Say "'"FileName"' condition is '"RC"'"; ReturnCode = Max(12, ReturnCode); Return; InnerError: If Stream(FileName, "Description") \= "UNKNOWN:" then do; Call Stream(FileName, "Command", "Close"); If Result \= "READY:" then do; Say "Output '"FileName"' emergency close returned '"Result"'"; ReturnCode = Max(16, ReturnCode); End; End; Exit Max(12, ReturnCode);