× 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.



In an earlier post, I expressed a desire to have the <Ctrl+F> FINDCHANGE
function be able to detect a selected text string and to automatically find
the next occurrence of that selected text string or if no selected text was
found to display the dialog box for entry of a text string. Thanks to Barry
Hoffman for pointing out the LP_FINDSEL command to me, I was able to come up
with the following workaround to achieve the results I wanted.

First I created a macro called FIND.LX that consists mainly of the following
lines.


'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_FINDCHANGE'

/* Otherwise, find the next occurrence of the selected text */
else do
    'LP_FINDSEL'

exit 0


Then, I modified my profile.lx file to tie this macro to <Ctrl+F> as
follows.

 'set action.c-f MACRO FIND'


These modifications achieved the results I wanted but I found that I
actually preferred to have this same functionality on the <CTRL+N> shortcut
key so I created another macro called FINDNEXT.LX.


'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, find the next occurrence of
the previously */
/* selected text
*/
if (block start = 0 | blockend = 0 | blockend < blockstart | blockdoc <>
docnum) then do
    'LP_FINDNEXT'

/* Otherwise, find the next occurrence to the selected text. */
else do
    'LP_FINDSEL'

exit 0


Then, I modified my profile.lx file to tie this macro to <Ctrl+N>.

 'set action.c-n MACRO FINDNEXT'


By using <Ctrl+T,N> then successive <Ctrl+N>'s I can efficiently select a
format name or variable name and then jump down through the code to the next
occurrence of that name without having to take my hands off the keyboard.


Regards,

Brian



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.