/* Rexx - Edit macro to find a string show only lines with the */ /* string and a few lines above and below found strings. */ /* This uses the COMPARE EXCLUDE command to perform the */ /* line exclude function. */ /* -------------------------------------------------------------- */ /* Author: Doug Nadel * / /* -------------------------------------------------------------- */ Address isredit /* */ 'MACRO (PARM)' /* Accept input string */ If parm ^= '' Then /* Do nothing if no parameters */ Do /* */ 'RESET LABEL' /* Remove all existing labels */ 'F FIRST 'parm /* Find first strin occurrence */ Do While(rc=0) /* For each occurance */ 'LABEL .ZCSR = 'label()' 0'/* Assign a label to line */ 'RFIND' /* Find next occurance */ End /* */ 'COMPARE X' /* Exclude everything exept */ /* Labels and above/Below lines */ zzz='RESET LABEL' /* Remove all labels */ '(XSTAT) = XSTATUS .ZFIRST' /* Save exclude status of line 1 */ 'LOCATE .ZFIRST' /* Move display to line 1 */ 'XSTATUS .ZFIRST = 'xstat /* Restore line 1 exclude status */ End /* */ Exit 0 /* Always return a zero */ /* -------------------------------------------------------------- */ label:Procedure Expose labelnum /* Routine to generate a unique */ If datatype(labelnum,'N')=0 Then /* Edit line label */ labelnum=0 /* */ Else /* */ labelnum=labelnum+1 /* */ Return '.'translate(right(labelnum,4,'0'),'ABCDEFGHIJ','0123456789')