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

Re: Self-referential problem



Reply to note from Carl Distefano  Sun, 22 Feb 2009
22:52:16 -0500

One thing leads to another. It dawned on me that, with only a little
extra effort, the routines that search for "unSEarchable" strings
could be made to perform "wildcard" (meta-wildcard?) searches for
*any* 3-byte character. Frame SEFU, for Xy4+U2, now has three new
optional arguments: arg "3" (with double quotes) searches for any 3-
byte character; arg "255" searches for any 3-byter with Ascii-255 in
the first byte; arg "254" searches for any 3-byter with Ascii-254 in
the first byte (i.e., any character in the Speedo extended character
set).

The companion routine for Xy3 only requires arg "3", because in Xy3
all 3-byters have Ascii-255 in the first byte.

Both routines now offer the option to DeFine the search string in
text. This is especially useful in Xy3, where functions and other
3-byte characters cannot be put on the CMline without special
effort. With the DeFine option, you simply construct your argument
in text, DeFine it, and RUN SEFU3.PM. If the search string is found,
the next occurrence of it is automatically DeFined in order to
facilitate repeated searches.

Speaking of repeated searches, I should add that both of these
routines flag the *next* occurrence (only) of the search string in
the current file -- just like the native SEarch command. Hit
 (or, for the Xy3 routine, your eXeCute or Enter key)
repeatedly to find additional occurrences. (To aid in this, the Xy3
routine restores the CMline after each run.)

By the way, the "F" in the routine name alludes to the fact that, in
both of these routines, the cursor comes to rest *on* the found
character or string, not after it -- in other words, they behave
like the SE/F command in Xy4. These routines differ from the native
SEarch command, however, in that it's not necessary (nor is it
permitted) to enclose the search string in separators.

Here's frame SEFU for Xy4. SEFU3.PM, for Xy3, appears further below.

'%--_XYENCode_start--
{{5SEfu}}_Search_for_unSEarchable_strings_(wildcards,_chars_
embedded_in_3-byte_chars,_including_"wildcard"_3-byter_search)
_[CLD_rev.2/23/09]'^
~B',*','^
',*',__Search'-string_may_be_DeFined_in_text'^
',*',____(CMline_arg_takes_precedence_over_DeFined_text)'^
',*','^
',*',__Special_args_(double_quotes_required)'.'^
',*',__SEFU_"3"'^
',*',____performs_"wildcard"_search_for_any_3-byte_char'^
',*',__SEFU_"255"'^
',*',____performs_"wildcard"_search_for_any_3-byte_char_with'^
',*',____Ascii-255_in_byte_#1'^
',*',__SEFU_"254"'^
',*',____performs_"wildcard"_search_for_any_3-byte_char_with'^
',*',____Ascii-254_in_byte_#1_(Speedo_extended_character_set)'^
',*','^
~==1~>
  ~
  ~<1~>'DZ
   ~>0~>
     ~
     ~-~~>
   ~
  ~
  ~>0~>
   'BXes_1'Q2
   'GT
   ~'NO
   ~
   ~
   ~=="""255"""~>
     ~~>
     ~
   ~
   ~=="""254"""~>
     ~~>
   ~
   ~
   ~~>'DX
   ~
   ~'YD'CR
   ~<1~>
     ~+1024~>'DF
     'BXjmp_~'Q2
     ~<1~>'CR'CL
     ~'DF
     ~
     ~<>"""3"""~>
      ~
      ~~{~~>
      ~<>~&~<0~>
        ~
      ~
      ~+~~>
      ~
      ~>-1~>
        ~+~~>
      ~'YD
      'BXjmp_~'Q2
      ~>0~>
        ~+~~>'DO'FF'DF
        'BXjmp_~'Q2
        'DF'DB
      ~
      ~="+~~>
      ~~
     ~
     ~
     ~~=~~>
      ~~{~~>
     ~
     ~~=~~>
      ~<0'|~~{~<~~>
        ~~{~~>
      ~
     ~
     ~<0~>
      ~
     ~
     ~
   ~
   'BXjmp_~'Q2
   'DO'FF
   ~~
  ~
  ~~>~
~
~~B'^
'^
'%--_XYENCode___end--


SEFU3.PM for XyWrite III+:

'%--_XYENCode_start--
~'^
SEFU3.PM_for_XyWrite_III+_--_CLD_rev.2/23/09'^
Search_for_unsearchable_strings_(chars_within_3-byte_
chars,_etc.)'^
'^
Usage'.'^
RUN_SEFU3.PM_[search'-string]|"3"'^
Works_from_cursor_position_to_end_of_file'^
'^
Arg_"3"_(double_quotes_required)_performs_a_"wildcard"'^
__search_for_*any*_3-byte_character'^
Search'-string_may_be_DeFined_in_text',_CMline_argument'^
__takes_precedence_over_DeFined_text'^
'^
~
~~>
~<>1~>
  ~~
~
~~>
~~>'NO~>~'BCes_1'XC
~~>
~~>
~
~)>0~>
  ~
~
~<>~~>'DF
  ~
  ~-~~>
~
~'BCes_0'XC
~)<1~>'BC~
  ~~>~
~'BC'GT
~
~
~
~
~==~~>
  ~~>
~
~~>
~'BCWorking...'DX'GT
~'XD
~~>'CR
~==~~>
  ~'BCjmp_~'XC
  'BC~'GT'DO'FF
  ~~
~
~+1024~>'DF'BCjmp_~'XC
'BC'GT'DF
~
~)<1~>'XD
  ~
~
~~{~<0~>
  ~
~
~~>
~+~~{~~>
'XD'BCjmp_~'XC
~>0~>'DO'FF'DF
  ~+~~>'BCjmp_~'XC
  'DF'DB
~'BC~'GT'DO'FF
~~'^
'%--_XYENCode___end--

Is this wild stuff, or what?

--
Carl Distefano
cld@xxxxxxxx