Replace command

David Coker davidocoker at gmail.com
Sat Apr 10 10:46:50 EDT 2010


Howdy folks,
Ran across another head scratcher that I need some help with.

Let's say I have put the following tongue twister into a variable
called tContainer:

Peter Piper picked a peck of pickled peppers.
If Peter Piper picked a peck of pickled peppers,
then where's the peck of pickled peppers that
Peter Piper picked?

the code:
replace "Piper" with "Jones" in tContainer

... obviously replaces every instance of the matching word found in
the container.

Am I overlooking a simple way to limit the number of matching words to
only one occurrence, other than processing the contents one line at a
time outside of the container?

If there is some other such command or function in RevTalk, I have
completely overlooked it and badly need some guidance.

Best regards,
David C.



More information about the Use-livecode mailing list