String Search & Replace?

Fairlight fairlite at fairlite.com
Thu Nov 4 08:07:52 PST 2004


Y'all catch dis heeyah?  Joe Chasan been jivin' 'bout like:
> 
> you could make a complicated loop with mid, as you suggest, and
> also making sure that it is only run once, as you can guess what
> will happen with each pass on the same data.

Such a loop isn't complicated.  I've done it when parsing HTML and XML.

You could have it run multiple times--just make sure that when you get the
instr() result on " that you also check the (result - 1) for a \ and omit
the change at that position if it's already a \ from a prior replacement.
You can run it as many times you like then.  

Oh, and make sure that you start your instr() check at your last
double-quote reported position + 1 after substitution, since you've
expanded the string, or it would be less efficient even though it would
still work.

mark->
-- 
Bring the web-enabling power of OneGate to -your- filePro applications today!

Try the live filePro-based, OneGate-enabled demo at the following URL:
               http://www2.onnik.com/~fairlite/flfssindex.html


More information about the Filepro-list mailing list