× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



[ Converted text/html to text/plain ]
I found something that works, most of the time.  I have a MYFINDNEXT.LX macro
(See source later in the email), and have used the PROFILE.LX to map this to
Ctl+N.
I used Jim's idea of Ctrl+V to paste a copy of the new code, but when you do a
find, the found code is highlighted, but paste will not overlay the text.  I
then can use 3 keys to do the replace.  Ctl+N to find the next occurrence,
Ctl+T to highlight the found word (won't work for more than one word) then
Ctl+V to paste the new word over the found word.
This works as long as only one word is being replaced.  The other problem that
this has is that if the word is found in a comment (using in CL currently, but
I imagine the same happens in COBOL or RPG) the find next will not go to the
next occurrence.
Can someone tell me why the found highlight is different than the selected
highlight?  Also I think there is a random feature (read BUG) in the macro -
If there is no text highlighted I think it should show me the find/replace
dialog box, not find the next occurrence of the of the "FIND" field.  I like
the way it is working and not showing me the dialog, but that is not what I
think the macro ought to do.
If anyone has Ideas to make this work better and/or with phrases, I'm open to
suggestions.
Line added to PROFILE.LX:
'set action.c-n MACRO MYFINDNEXT'
Source for MYFINDNEXT.LX:  (compliments of several participants in these
discussions)
/* MYFINDNEXT.lx - used to execute a find in the Code 400 Editor      */
'extract blockstart'     /* find start position of block highlight  */
'extract blockend'       /* find end position of block highlight    */
'extract blockdoc'       /* block in document                       */
'extract docnum'         /* current document                        */
/* determine if any text selected and if not display the find/change dialog */
if (blockstart = 0 | blockend = 0 | blockend < blockstart | blockdoc <>
docnum),
 then do
   'LP_FINDNEXT'
 end
/* Otherwise, find the next occurrence of the selected text */
 else do
    'LP_FINDSEL'
 end
exit 0
At 06:54 PM 1/17/2002 -0800, you wrote:

What I do in this case.
Search for the string to find.  Type over the replacement when I get
there.  Then highlight what I typed and copy it to the clipboard (Ctrl-C
or Ctrl-Insert).  From then on in it's Shift-F4 to find next one, Ctrl-V
if I want to replace it.
Regards,
Jim Langston
-----Original Message-----
From: Jim Essinger [mailto:esinger@fmtc.com[1]]
Sent: Thursday, January 17, 2002 3:17 PM
To: code400-l@midrange.com
Subject: Find and Replace dialog question
Greetings!
Using the find and replace dialog is cumbersome. I want to replace multiple
occurrences of the same find string, but to view them before they are
replaced.  Not all need to be replaced.  I need to do this over multiple
files I have loaded into Code editor.  I can/have set up a key  (alt 'N'
with find next macro) set that will let me find the next occurrence of the
string in the find prompt, but have no way to do a replace without bringing
up the dialog box, and clicking on the replace button.  Is there a way
(command to put in a macro - or some other way to assign to a key) to tell
find and replace to replace this occurrence and find the next occurrence?
Also have a problem that in a browse only file you can not do a find
because the Find/Replace dialog box won't open in a browse session.
Any thoughts on how to speed up this process would be appreciated.
_______________________________________________

===References:===
  1. mailto:esinger@fmtc.com



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.