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:
Where's Cart Created ? (1997)
Forms Search Questions (1997)
RAM to disk - well correction. (2002)
Emailer tracking (1997)
WebDNA Quick Reference (Reserved Words) (2000)
[WebDNA] Advice needed (2013)
WebCommerce: Folder organization ? (1997)
Middle Context (2002)
creator code (1997)
Secure server question (1997)
[isfile] ? (1997)
TCPConnect / TCPSend to Solaris NN Enterprise (2002)
Online reference (1997)
Running 2 two WebCatalog.acgi's (1996)
Can anyone help me with this shipping thing? (1998)
Re:no [search] with NT (1997)
Secure Server basic question... (1997)
turning every 5th line red (1999)
Another Excel Problem (2003)
WebDNA Writer Needed (1997)