/* * * ----------------------------------------------------------------- * Execution of this macro requires a license for uni-XEDIT Extended * for each concurrent user of the macro. * ----------------------------------------------------------------- * * every - macro to extend the uni-XEDIT ALL command * * Syntax and operands described below in the "help" section. To * view help while in an edit session, type * * every ? * * on the uni-XEDIT command line. * * * * Modification History: * * -- --- -- Macro originally contributed by Dan Hofferth, Allison * Engine Company * 09 Feb 96 twg Standard TWG comments added; minor change to * descriptive text in help section * * */ /* "EVERY" is an ALL command replacement with extra-features. -iedh1 */ If Arg(1) = '?' Then Do Say ' -----' Say ' EVERY - A replacement for uni-XEDIT''s "ALL" command.' Say ' -----' Say ' With the standard uni-XEDIT "ALL" command, you enter a search-' Say ' string that is used to restrict the display to lines containing' Say ' one or more occurrences of that string. With "EVERY", you can' Say ' also display -n lines above, and +n lines after, each match.' Say ' ' Say ' Use: "EVERY rtarget [-n] [+n]" to restrict the display' Say ' or: "EVERY" to restore full display' Say ' ' Say ' Example: "EVERY /PWSD/ +1" displays all lines containing the' Say ' string "PWSD" and one line after each match.' Say ' ' Say ' Note: It is possible to set a uni-XEDIT "synonym" to have this ' Say ' macro substituted whenever you type in an ALL command...' Say ' so you won''t have to change your typing habits. To see if ' Say ' this synonym has already been set for you (system profile?),' Say ' type "Q SYNONYM ALL". If it hasn''t been set, you can add' Say ' "SET SYNONYM ALL 3 MACRO every" to your "~/.profile.xedit".' Say ' ' Say ' These additional macros in the Sample Library give you even more' Say ' control over displayed and hidden lines in uni-XEDIT:' Say ' ' Say ' more - Unhide selected lines in an EVERY-restricted display.' Say ' less - Hide additional lines from an EVERY-restricted display.' Say ' invert - Reverse "EVERY" displayed and hidden lines.' Say ' toggle - Toggle between full and EVERY-restricted display.' Say ' weed - Delete specified lines, or delete existing hidden lines.' Say ' altered - Display lines altered or added since last save.' Say ' nocomm - Hide FORTRAN source code comment cards.' Say ' ' Exit End Parse Arg argline delim = Left( argline, 1 ) rt_start = 1 Do While rt_start > 0 rt_end = Pos( delim, argline, rt_start+1) If rt_end = 0 Then rt_end = Length( argline ) rt_start = Pos( delim, argline, rt_end+1 ) End rtarget = Left( argline, rt_end ) deltas = Substr( argline, rt_end+1 ) plus = 0; minus = 0 Do i = 1 to Words( deltas ) delta = Word( deltas, i ) If Datatype( delta, 'W' ) Then Do If delta >= 0 Then plus = 0 + delta Else minus = 0 - delta End End 'COMMAND EXTRACT /LINE/DISPLAY/WRAP/STAY/MSGMODE' 'COMMAND SET DISPLAY 0 *' 'COMMAND :0' If rtarget = '' | rtarget = '/' Then Do 'COMMAND SET SELECT 0 *' 'COMMAND :'line.1 'COMMAND SET DISPLAY 0 0' Exit End 'COMMAND LOCATE' rtarget If rc ^= 0 Then Do save_rc = rc 'COMMAND :'line.1 'COMMAND SET DISPLAY 'display.1 display.2 Exit save_rc End 'COMMAND SET WRAP OFF' 'COMMAND SET STAY ON' 'COMMAND SET SELECT 0 :0' 'COMMAND SET SELECT 0 *' 'COMMAND SET MSGMODE OFF' Do Forever 'COMMAND SET SELECT 1 -'minus+1 'COMMAND SET SELECT 1 +'plus+1 'COMMAND LOCATE' rtarget If rc ^= 0 Then Leave End 'COMMAND SET MSGMODE 'msgmode.1 'COMMAND SET STAY 'stay.1 'COMMAND SET WRAP 'wrap.1 'COMMAND :0' 'COMMAND SET DISPLAY 1 1' Exit