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* of words. 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 to ABC DEF GHI JKL MNO PQRTo produce this result: DEF DEF JKL JKL PQR PQR STUVWXYZ See, 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 Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Associated Messages, from the most recent to the oldest:

    
  1. Re: Question about replacing words (Peter Ostry 1998)
  2. Re: Question about replacing words (Kenneth Grome 1998)
  3. Re: Question about replacing words (Grant Hulbert 1998)
  4. Re: Question about replacing words (Peter Ostry 1998)
  5. Re: Question about replacing words (Kenneth Grome 1998)
  6. Re: Question about replacing words (Peter Ostry 1998)
  7. Re: Question about replacing words (PCS Technical Support 1998)
  8. Re: Question about replacing words (Kenneth Grome 1998)
  9. Re: Question about replacing words (Grant Hulbert 1998)
  10. Re: Question about replacing words (Kenneth Grome 1998)
  11. Re: Question about replacing words (Kenneth Grome 1998)
  12. Re: Question about replacing words (Kenneth Grome 1998)
  13. Re: Question about replacing words (Grant Hulbert 1998)
  14. Re: Question about replacing words (Christer Olsson 1998)
  15. Re: Question about replacing words (Alex McCombie - New World Media 1998)
  16. Re: Question about replacing words (Alex McCombie - New World Media 1998)
  17. Re: Question about replacing words (Dave MacLeay 1998)
  18. Re: Question about replacing words (Christer Olsson 1998)
  19. Re: Question about replacing words (Kenneth Grome 1998)
  20. Re: Question about replacing words (Alex McCombie - New World Media 1998)
  21. Re: Question about replacing words (PCS Technical Support 1998)
  22. Re: Question about replacing words (PCS Technical Support 1998)
  23. Re: Question about replacing words (Alex McCombie - New World Media 1998)
  24. Question about replacing words (Alex McCombie - New World Media 1998)
>No, the point is that Ken is asking it to do a replace from a *list* of words. 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 to ABC DEF GHI JKL MNO PQRTo produce this result: DEF DEF JKL JKL PQR PQR STUVWXYZ See, 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 Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://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)