Re: [WebDNA] Has [middle] always worked this way?

This WebDNA talk-list message is from

2014


It keeps the original formatting.
numero = 111538
interpreted = N
texte = I'm not trying to remove every instance, I'm just trying to find them, one at a time, inside the loop ... and middle is the correct tool for this purpose. I'm just surprised to get "000" rather than a blank/empty value after the final "abc" has been removed from the 'ts' value, that's all. If this is not a bug then maybe middle has always worked like this. I just figured that it started looking for the match string beginning with the first character of the 'ts' value, and then it ignored every character it had already looked at -- until it either found the match string or failed to find it. Either way, I thought it would return only the chars that had not yet been looked at ... but that's apparently not the case. Regards, Kenneth Grome WebDNA Solutions http://www.webdnasolutions.com Web Database Systems and Linux Server Management On 08/27/2014 08:20 AM, WebDNA wrote: > I'm not following... wouldn't [grep] remove every instance? > > Kenneth Grome wrote: >> I was trying to using this code to extract all the occurrences of >> abc from the original ts value: >> >> [text]ts=abc123abc456abc789abc000[/text] >> >> [loop start=1&end=9] >> [text]ts=[middle startafter=abc][ts][/middle][/text] >> [appendfile lines][index]-[ts] >> [/writefile] >> [/loop] >> >> I was expecting this: >> >> 1-123abc456abc789abc000 >> 2-456abc789abc000 >> 3-789abc000 >> 4-000 >> 5- >> 6- >> 7- >> 8- >> 9- >> >> But instead I got this: >> >> 1-123abc456abc789abc000 >> 2-456abc789abc000 >> 3-789abc000 >> 4-000 >> 5-000 >> 6-000 >> 7-000 >> 8-000 >> 9-000 >> >> I had expected middle to produce blank/empty results when it could >> not find the first occurrence of abc, but instead it returned the >> entire ts value. >> >> Has middle always worked like this, and I have simply never used >> middle in this manner during 20 years of WebDNA programming? >> >> Or is this a glitch or bug? >> >> Regards, >> Kenneth Grome >> WebDNA Solutions >> http://www.webdnasolutions.com >> Web Database Systems and Linux Server Management >> >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> > --------------------------------------------------------- This > message is sent to you because you are subscribed to the mailing > list . To unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] Has [middle] always worked this way? (Kenneth Grome 2014)
  2. Re: [WebDNA] Has [middle] always worked this way? (Toby Cox 2014)
  3. Re: [WebDNA] Has [middle] always worked this way? (Kenneth Grome 2014)
  4. Re: [WebDNA] Has [middle] always worked this way? (Kenneth Grome 2014)
  5. Re: [WebDNA] Has [middle] always worked this way? (WebDNA 2014)
  6. Re: [WebDNA] Has [middle] always worked this way? (Dan Strong 2014)
  7. [WebDNA] Has [middle] always worked this way? (Kenneth Grome 2014)
I'm not trying to remove every instance, I'm just trying to find them, one at a time, inside the loop ... and middle is the correct tool for this purpose. I'm just surprised to get "000" rather than a blank/empty value after the final "abc" has been removed from the 'ts' value, that's all. If this is not a bug then maybe middle has always worked like this. I just figured that it started looking for the match string beginning with the first character of the 'ts' value, and then it ignored every character it had already looked at -- until it either found the match string or failed to find it. Either way, I thought it would return only the chars that had not yet been looked at ... but that's apparently not the case. Regards, Kenneth Grome WebDNA Solutions http://www.webdnasolutions.com Web Database Systems and Linux Server Management On 08/27/2014 08:20 AM, WebDNA wrote: > I'm not following... wouldn't [grep] remove every instance? > > Kenneth Grome wrote: >> I was trying to using this code to extract all the occurrences of >> abc from the original ts value: >> >> [text]ts=abc123abc456abc789abc000[/text] >> >> [loop start=1&end=9] >> [text]ts=[middle startafter=abc][ts][/middle][/text] >> [appendfile lines][index]-[ts] >> [/writefile] >> [/loop] >> >> I was expecting this: >> >> 1-123abc456abc789abc000 >> 2-456abc789abc000 >> 3-789abc000 >> 4-000 >> 5- >> 6- >> 7- >> 8- >> 9- >> >> But instead I got this: >> >> 1-123abc456abc789abc000 >> 2-456abc789abc000 >> 3-789abc000 >> 4-000 >> 5-000 >> 6-000 >> 7-000 >> 8-000 >> 9-000 >> >> I had expected middle to produce blank/empty results when it could >> not find the first occurrence of abc, but instead it returned the >> entire ts value. >> >> Has middle always worked like this, and I have simply never used >> middle in this manner during 20 years of WebDNA programming? >> >> Or is this a glitch or bug? >> >> Regards, >> Kenneth Grome >> WebDNA Solutions >> http://www.webdnasolutions.com >> Web Database Systems and Linux Server Management >> >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> > --------------------------------------------------------- This > message is sent to you because you are subscribed to the mailing > list . To unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us 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:

Too Many Items found (2000) HomePage Caution (1997) Modifying order output (1997) b12 cannot limit records returned and more. (1997) WebCat2 - Getting to the browser's username/password data (1997) [cart] tag (2000) WebCatalog Review (2001) WebCat2final1 crashes (1997) New Plug-in and Type 11 errors (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Changing Date Format in Field (1999) WebCat2 - [format thousands] (1997) Multiple catalog databases and showcart (1997) WebDNA Server Not Running (2005) Add to Cart & List of Products (1997) taxRate is fine but taxTotal isn't (1997) Autonumber (2003) Re:Emailer Set Up (1997) Setting up shop (1997) Search/sort in URL Was: GuestBook example (1997)