Search/Replace Strange Behavior
Wilhelm Sanke
sanke at hrz.uni-kassel.de
Fri Jul 15 17:02:16 EDT 2005
On Fri, 15 Jul 2005, Mark Swindell <mdswindell at charter.net> wrote:
> >> The find/replace dialog really ought to be using htmlText, I think,
> >> although then a certain amount of conniptions would be required to
> >> avoid replacing text in an HTML tag
>
> It's a pretty nasty nuance, then. How's that?
>
> It renders the find and replace function useless for formatted text.
> And it did come as a shock, as it almost destroyed hours of work,
> because it can't be undone. (No one had ever mentioned that I should
> back up my stacks regularly.) This seems like a pretty big thing that
> ought to be addressed by the engineering corps up in Edinborough, no?
>
> Mark
Hi Mark,
at least Jeanne A. E. DeVoto pointed into the right direction:
- Put the HTMLtext of the field into a variable
- do the "replace" in the variable
- set the HTMLtext of the field to the variable
like
"put the htmltext of fld "X" into tInterim
replace <searchstring> with <replacestring> in tInterim
set the htmltext of fld "X"to tInterim".
This is applicable in most cases,
e.g. the coloring of the searchstrings in my "Searchdocs" stack is
brought about by the lines
"put the htmltext of fld "X" into tInterim
replace <searchstring> with "<FONT
color=#FF0000>"&searchstring&"</FONT>" in tInterim
set the htmltext of fld "X"to tInterim"
Regards,
Wilhelm Sanke
More information about the use-livecode
mailing list