[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: SWEEP WORKS! searching subdirectories



Reply to note from Judith Davidsen  Sat, 20
Jul 2002 17:37:30 -0400

Judith:

> Just installed latest U2 and then performed the fix you
> recommended in FUNCTEST and I want to report publicly that this
> works!

PMJI, but glad to hear it.

> Now...is there a shorter command that can be used?

I don't think so, not if you want to execute SE the U2 frame as
opposed to SE the less versatile native command. However, it's easy
enough to create a shorter command. (See below.)

> Or can the command be loaded on a key

Sure. All you need is a .KBD macro that puts a SWEEP search
statement, minus the search term, on the CMline. The following puts
the cursor between the two quotation marks, so you can type the search
term without further ado:

nn=BCs,w,e,e,p, ,[,S,V,5,0,CO*,.,*,",",],COJ,M,2,.,s,e,Q,2,PWPWCLCLCL

(Footnote: A comma after the "se" in JM2.seQ2 is harmless but
unnecessary. Hence, there's no need for a func CO in the .KBD macro,
here: ...J,M,2,.,s,e,COQ,2....)

As for creating a shorter command, Robert may have a better idea, but
for now try the following frame SSE (Sweep SEarch). Since you've
upgraded to v112, you can use our new, easy-as-pie procedure for
installing new frames. Just decode what's below with DECODE,
DeFine the resulting XPL code (be sure to DeFine the entire frame),
and issue ADD2U2. Voila, the frame has been added to U2.

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5sse*}} Sweep SEarch through subdirectories [CLD][cr|lf]{2
}{<}IF{<}VA|50{>}<1{>}{<}PRSSE[/sw1/sw2] [filespec]"search_te
rm"{>}{<}EX{>}{<}EI{>}{<}SX01,{<}IS50{>}+"[255+192+142]"{>}{<
}SV02,{27}X[255+192+142]{>}{<}XS01,02,,02,03{>}{<}SV01,{27}X{
>}{<}XS02,01,,01,02{>}{<}IF{<}IS01{>}{238}{<}IS50{>}==0{>}{<}
SX50,"*.*"+{<}IS50{>}{>}{<}EI{>}{<}SX01,{<}VA$FR{>}{>}{<}SV02
,sse{>}{<}XS01,02,,02,02{>}{<}SX50,"[SV50,"+{<}IS50{>}+"],JM2
{46}se"+{<}IS02{>}+"Q2"{>}[JM_]2.sweep[Q2_]{2}[cr|lf][cr|lf]
-nd
XPLeNCODE

The syntax is SSE [filespec]"search_term". If you omit the
filespec, the search traverses all files (*.*) in each (sub)directory.
As with the native SEarch command, the separator can be any character
not contained in the search_term itself. Case-absolute searches and
SEarch command switches are permitted, e.g., SSEA/W /Action/.
Naturally, wildcards are supported, including the reverse-video "&"
(logical AND) and "\" (logical NOT) wildcards specific to the Jumbo
U2.

>From SSE it's a short hop to a generic frame that extends this
straight-forward (non-XMACRO) CMline syntax to any U2 command:

XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5sweep2}} Execute SWEEP on U2 framename [args] [CLD][cr|lf
]{2}{<}IF{<}VA|50{>}<1{>}{<}PRSWEEP2 framename [args]{>}{<}EX{>}{<}EI{>}{<}IF" "{238}{<}IS50{>}<0{>}{<}SX50,{<}IS
50{>}+" "{>}{<}EI{>}{<}SV51, {>}{<}SV52,{>}{<}XS50,51,51,,52{
>}{<}SX50,"[SV50,"+{<}IS52{>}+"],JM2."+{<}IS51{>}+"Q2"{>}[JM_
]2.sweep[Q2_]{2}[cr|lf][cr|lf]
-nd
XPLeNCODE

With SWEEP2, the SSEA command above would be restated as
SWEEP2 SEA/W *.*/Action/. Note that, with SWEEP2, a filespec
must be stated explicitly if you wish to search across directories;
otherwise, the search command reverts to its default operation,
searching within the current file only. (SSE supplies *.*
automatically if no other filespec is stated.)

SWEEP2 requires a bit more typing (and thought), but you get the
flexibility to perform other U2 operations across subdirs, e.g., a
Change-Verify: SWEEP2 CVA/W *.txt"Action"Deed".

These are exploratory ideas on which Robert will no doubt want to
weigh in.

--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/