Loading ...
Sorry, an error occurred while loading the content.

24161RE: Setting up F3 for For Find

Expand Messages
  • joy8388608
    Nov 13, 2013

      I had this in my library and may do what you need.

      You call this clip from another to set up the Find and Replace dialog.

      Note you do have to currently click the FIND button to initiate the new search before moving to F3. I think it would be simple to add some code to do that first click for you.



      ; Written By Joy M

      ; call with ^!FarClip "<Library>:SetFindAndReplace" 

      ;   FINDstring[,[REPLACEstring,[FlagRE,[FlagCS]]]]]

      ; to set both FIND and REPLACE searchstrings in FIND and REPLACE dialog

      ; as well as Case Sensitive option and whether this is Standard or REGEX search.

      ; *** Before calling set %SFARDelim% to any (non case sensitive) delimiter (, x ; |@#@x@#@| zzz, etc)

      ; so SetArray doesn't parse on a valid character

      ; i.e., don't set it to a comma if there is a comma in the FIND or REPLACE string.

      ; FlagRE is for RegExp checkbox and can be  1, TRUE, YES, Y, or ON, 0, FALSE, NO, N, or OFF  

      ; FlagCS is for Case Sensitive checkbox and can be  1, TRUE, YES, Y, or ON, 0, FALSE, NO, N, or OFF

      ; Example with delim=*  FindString*RepString*True*No

      ;       will insert FindString and RepString and set RegExp on and Case Sensitive Off

      ; Example with delim=,  xxx,yyy,N

      ;       will insert xxx and yyy and set RegExp off and Case Sensitive Off

      ; Case Sensitive defaults to OFF and Search Type defaults to Standard

      ; updated 4:30 PM Thursday 01/03/2013 to work with ver 7

      ^!KeyBoardDelay 60

      ^!Menu Search/Replace

      ^!IfAppOpen "Find and Replace" Next Else Skip_-1

      ; Set to Standard search


      ; Set to search Down


      ; Uncheck All Documents chechbox

      ^!Keyboard ALTDOWN #m# ALTUP #-#

      ; Uncheck Count Occurences chechbox

      ^!Keyboard ALTDOWN #o# ALTUP #-#

      ; Uncheck Whole Words chechbox

      ^!Keyboard ALTDOWN #w# ALTUP #-#

      ; Uncheck Case Sensitive checkbox

      ^!Keyboard ALTDOWN #c# ALTUP #-#


      ^!SetListDelimiter ^%SFARDelim%

      ^!SetArray %SFAR_Array%=^&

      ; ---Move to the FIND field

      ; Need both as dialog box doesn't always change when search type updated.

      ^!Keyboard ALTDOWN #n# ALTUP

      ^!Keyboard ALTDOWN #g# ALTUP

      ; Clear what is in the FIND field

      ^!Keyboard DELETE

      ^!SetClipBoard ^%SFAR_Array1%

      ; Enter FIND string in dialog

      ^!Keyboard CtrlDown #v# CtrlUp

      ; ---Move to Replace field

      ^!Keyboard Altdown #P# Altup

      ; Clear what is in the REPLACE field

      ^!Keyboard DELETE

      ; Enter Replace string in dialog

      ^!SetClipBoard ^%SFAR_Array2%

      ^!Keyboard CtrlDown #v# CtrlUp

      ; ---Handle RegExp Checkbox

      ; Already set to Standard Search

      ^!IfEmpty "^%SFAR_Array3%" SKIP_2

      ^!IfFalse ^%SFAR_Array3% SKIP_1

      ^!Keyboard CtrlDown ALTDOWN #r# ALTUP CtrlUp

      ; ---Handle Case Sensitive chechbox

      ; already set to Not Case Sensitive

      ^!IfEmpty "^%SFAR_Array4%" SKIP_2

      ^!IfFalse ^%SFAR_Array4% SKIP_1

      ^!Keyboard ALTDOWN #c# ALTUP #+#

      ; ---Move to Replace field

      ^!Keyboard Altdown #p# Altup

      ; Restore Clipboard contents


      ^!ClearVariable %SFAR_ARRAY%


      ---In ntb-clips@yahoogroups.com, <Axel-Berger@...> wrote:

      I really, really need a simple clip command or even better a modifier
      for the ^!Find command to set up <F3> = search next with the same
      parameters as just used in the clip.

      Just as one example I have a find clip that searches for different
      things in succession and ends where successful. Another clip makes one
      of a set of changes depending on the content of the line finds itself
      in. It is far, far easier to do more of the same through a successsion
      of <F3><Esc><Return> than one of <Esc><Type letter><Return><Esc><Type
      another letter><Return>.

      For ending a clip with a ^!Find and then continuing through the file
      with <F3> there is a sort of problematic and unreliable solution, but it
      really is a hassle. Things were far better before the recent change of


      Dipl.-Ing. F. Axel Berger Tel: +49/ 2174/ 7439 07
      Johann-H├Ąck-Str. 14 Fax: +49/ 2174/ 7439 68
      D-51519 Odenthal-Heide eMail: Axel-Berger@...
      Deutschland (Germany) http://berger-odenthal.de
    • Show all 2 messages in this topic