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



Here is a very simple macro that should encapsulate the replace function
John was looking for.  Sorry for the mix-up.
It's very primitive; it'd be great to see somebody turn this into a real
dialogue box.  Also, it might be nice to save the strings for next time.
Not to mention the ability to be case sensitive or not.  As you can see, it
has a lot of shortcomings!  I call it RPL.LX.  Be sure to put it in your
private macro folder, not WDT400/macros.

/* Replace a string without losing your place */

/* Ask for the source string */
src = prompt('RPL.LX', 'Source string')
if src = '##PrOmPt_EsCaPe##' then
  exit

/* Ask for the target string */
tgt = prompt('RPL.LX', 'Target string')
if src = '##PrOmPt_EsCaPe##' then
  exit

/* save my place */
'mark set rpl'

/* up to the top of the file */
top

/* replace */
'change asis ,'src','tgt',bottom,,?'

/* go back to my place */
'mark find rpl'

exit

prompt:
parse arg title,prompt

'set lineread.title' title
'set lineread.prompt' prompt
'lineread 80'
'extract lastkey'
if lastkey = 'ESC' then
  return '##PrOmPt_EsCaPe##'
'extract lastline'
return lastline

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.