Re: Question about replacing words
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 19700
interpreted = N
texte = >No, the point is that Ken is asking it to do a replace from a *list* ofwords. It's easy to replace all occurrences of a single string ...Wait a minute ... all I originally asked for in late 1996 was a simple [change] context. Here's how I envisioned this capability to work, and this is essentially the same example I posted way back then:[change from=this text&to=that string]Change this text to something else.[/change]Result:Change that string to something else.As far as I was concerned back then -- and still today -- that's all I have ever needed. For multiple replacements I could have always nested several [change] contexts if necessary. And now that we have a [text] variable in 3.x, nesting would be foolish because the following example would be a lot cleaner:[text]value=ABC DEF GHI JKL MNO PQR STUVWXYZ[/text][search db=change.db&nefromdata=[blank]][founditems][text]value=[change from=[from]&to=[to]][value][/change][/text][/founditems][/search]The above code uses this change.db:from toABC DEFGHI JKLMNO PQRTo produce this result:DEF DEF JKL JKL PQR PQR STUVWXYZSee, Grant, the fact if the matter is that you really do *NOT* have to worry about writing code that makes replacements from a list of match strings. We can do all that multiple change stuff ourselves if we need to -- in our own webdna code -- and it looks like it would pretty simple judging from my example.So all we really *need* from you is a [change] context that replaces all occurrences of a defined to value with a defined from value.You said its easy to replace all occurrences of one string with another -- right?Therefore ... if you give us a simple [change] context that works like my example above, we can use our own ingenuity -- and all the other existing webcat capabilities -- to expand on it from there. That's what we've always done in the past ... and that's actually the FUN part of webdna programming!We can often come up with our own final solutions, provided you give us the basic tools to work with ... :)Sincerely,Ken Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Associated Messages, from the most recent to the oldest:
>No, the point is that Ken is asking it to do a replace from a *list* ofwords. It's easy to replace all occurrences of a single string ...Wait a minute ... all I originally asked for in late 1996 was a simple [change] context. Here's how I envisioned this capability to work, and this is essentially the same example I posted way back then:[change from=this text&to=that string]Change this text to something else.[/change]Result:Change that string to something else.As far as I was concerned back then -- and still today -- that's all I have ever needed. For multiple replacements I could have always nested several [change] contexts if necessary. And now that we have a
[text] variable in 3.x, nesting would be foolish because the following example would be a lot cleaner:
[text]value=ABC DEF GHI JKL MNO PQR STUVWXYZ[/text][search db=change.db&nefromdata=[blank]]
[founditems][text]value=[change from=[from]&to=[to]][value][/change][/text][/founditems][/search]The above code uses this change.db:from toABC DEFGHI JKLMNO PQRTo produce this result:DEF DEF JKL JKL PQR PQR STUVWXYZSee, Grant, the fact if the matter is that you really do *NOT* have to worry about writing code that makes replacements from a list of match strings. We can do all that multiple change stuff ourselves if we need to -- in our own webdna code -- and it looks like it would pretty simple judging from my example.So all we really *need* from you is a [change] context that replaces all occurrences of a defined to value with a defined from value.You said its easy to replace all occurrences of one string with another -- right?Therefore ... if you give us a simple [change] context that works like my example above, we can use our own ingenuity -- and all the other existing webcat capabilities -- to expand on it from there. That's what we've always done in the past ... and that's actually the FUN part of webdna programming!We can often come up with our own final solutions, provided you give us the basic tools to work with ... :)Sincerely,Ken Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
apparently to problem isolated (1997)
Understanding texta (1997)
[WebDNA] sem_open bugfix for os x version 6.2 (2012)
2 easy questions re: [showif] and [sendmail] (1997)
[WebDNA] V7 Download (2011)
About WebDNA (2006)
ErrorLog.txt bug (1998)
Problems when user hit back (2000)
Help with Shipping Costs (1997)
WebCat hosting providers? - one more option (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
WebCat editing, SiteGuard & SiteEdit (1997)
[TaxableTotal] - not working with AOL and IE (1997)
international time (1997)
Bug Report, maybe (1997)
Founditems context returning only 1 item (1997)
E-mail Attachments (1997)
Emailer (WebCat2) (1997)
[WebDNA] Date error (2017)
[WebDNA] File permissions on Windows? (2010)