Reply to note from "Yo Intl. YK" Tue, 18 Dec 2001
11:25:07 +0900
> >SE "Happy[5][S]New[5][S]Year"
>
> Absolutely amazing! Exactly what I need. How would I put this
> on a key in the keyboard file if possible? (Ever the optimist)
Wildcard [S] is produced by nn=WS; [5] is produced by nn=NN,5.
Search your .KBD file; they should already be there.
If you do this sort of search regularly, you may want to automate it
with a routine that inserts the wildcards on the command line for
you. The following U2 routine, called SEP, takes, for example, the
command SEP Happy New Year and, with a touch of the ,
changes it to SE "Happy[5][S]New[5][S]Year", executing the command
once and leaving it on the CMline for further use if desired. You
can vary the wildcard "fuzz factor" on the fly by prefacing the
search string with a numeric switch. Thus, SEP /10 Happy New
Year produces SE "Happy[1][0][S]New[1][0][S]Year". If you
want to increase or decrease the default fuzz factor of 5, edit the
User Variable.
To use SEP, first issue DECODE to decode what's below.
Then CoPy it into your U2 file. With U2 in the current window,
issue LH, then ABort the file. Do not attempt to SAve or
STore U2; you'll get a "Sharing violation" error.
P.S. to Morris: This is an example of a routine where BC...XC is
preferable to BX...Q2, to execute a command and then leave it on the
CMline for further use after the routine EXits.
Quiz for programmers: Only one of the 10 numeric wildcards, [0], is
present in SEP. How does it produce the other nine?
XPLeNCODE v2.0
b-gin [UNTITLED]
{{;5sep*}} SEarch for Phrases using variable separators [CLD{32}
12/17/01][cr|lf]{2};*;[cr|lf];*; SEP word1 word2 word3<
Helpkey> issues SE "word1[w5][wS]word2[w5][wS]word3"[cr|lf];*
; Optional fuzz factor (1-999) varies the maximum numbe
r of[cr|lf];*; separators between words, e.g.:[cr|lf]
;*; SEP /19 word1 word2 issues se "word1[w1][w
9][wS]word2"[cr|lf];*; For case-absolute search, use SE
PA [/#] word1 word2[cr|lf];*; Append SEarch sw
itches, if any, to framename, e.g.:[cr|lf];*; SEPA/F /1
0 word1 word2 issues SEA/F "word1[w1][w0][wS]word2"[
cr|lf];*; {<}NT1{>}[cr|lf];*;[cr|lf];*; User Variable
: Default "fuzz factor"[cr|lf]{<}SX01,5{>};*; <== Default = {
<}SX01,5{>} = use wildcard [w5][wS][cr|lf];*;[cr|lf];*; {<}NT
0{>}[cr|lf]{<}IF{<}VA|50{>}<1{>}{<}LBa{>}{<}PRSEP[A][/sw1/sw2
] [/#] word1 word2 ... word3 [# = 1-999]{>}{<}EX{>}{
<}EI{>}{<}SV02,{>}{<}SX03,@upr({<}VA$FR{>}){>};*;[cr|lf]{<}IF
{<}IS03{>}{240}"/"{>}{<}SV02,/{>}{<}XS03,02,04,,02{>}{<}SX03,
{<}IS04{>}{>}{<}EI{>}{<}IF" "{238}{<}IS50{>}<0{>};*;[cr|lf]{<
}LBb{>}[BC_]se{<}IF{<}IS03{>}{240}"A"{>}a{<}EI{>}{<}IF{<}VA|0
2{>}>0{>}/{<}PV02{>}{<}EI{>} "{<}PV50{>}"[XC_];*;[cr|lf]{<}IF
@not({<}ER{>}){>}{<}PR|| finds again{>}{<
}EI{>}{<}EX{>}{<}EI{>};*;[cr|lf]{<}IF{<}VA|01{>}<1!{<}VA{21}0
1{>}<1{>}{<}SX01,5{>}{<}EI{>}{<}SX04,{<}PV01{>}{>}{<}IF"/"{23
8}{<}IS50{>}==0{>}{<}SV01, {>}{<}XS50,01,04,,01{>}{<}SX04,{<}
VA@04/2{>}{>}{<}SX50,{<}IS01{>}{>}{<}EI{>}{<}IF{<}VA{21}04{>}
<1{>}{<}GLa{>}{<}EI{>}{<}IF{<}PV04{>}>999{>}{<}GLa{>}{<}EI{>}
{<}SV01,[w0]{>}{<}SV05,{192}{>}{<}XS01,05,05,,06{>}{<}SV01,{>
}{<}SV06,{176}{177}{178}{179}{180}{181}{182}{183}
{184}{185}{>}{<}SV07,{27}X{>}{<}SX08,{<}PV04{>}{>}{<}LBc{>}{<
}IF{<}VA|04{>}>0{>}{<}SV09,{>}{<}XS04,07,,08,09{>}{<}SX04,{<}
IS09{>}{>}{<}IF{<}PV08{>}<1{>}{<}SX08,{<}IS06{>}{>}{<}GLe{>}{
<}EI{>}{<}SV09,{>}{<}CUd,08{>}{<}SX09,{<}IS09{>}+"{27}X"{>}{<
}LBd{>}{<}XS06,09,,09,08{>}{<}LBe{>}{<}XS08,07,,09,10{>}{<}SX
01,{<}IS01{>}+{<}IS05{>}+"{192}"+{<}IS09{>}{>}{<}GLc{>}{<}EI{
>}{<}SX01,{<}IS01{>}+"[wS]"{>}{<}SV07, {>}{<}LBf{>}{<}IF{<}IS
50{>}{240}" "{>}{<}SV04,{>}{<}XS50,07,05,,04{>}{<}SX50,{<}IS0
5{>}+{<}IS01{>}+{<}IS04{>}{>}{<}GLf{>}{<}EI{>}{<}GLb{>}{2}[cr
|lf][cr|lf]
-nd
XPLeNCODE
Enjoy!
--
Carl Distefano
cld@xxxxxxxx
http://users.datarealm.com/xywwweb/