[WebDNA] Re: FindString fails ... but why?

This WebDNA talk-list message is from

2014


It keeps the original formatting.
numero = 111631
interpreted = N
texte = Never mind, I figured it out: FindString ignores linefeed characters whereas getchars does not -- so when you use findstring to locate the position of a string in a source with linefeeds in it, and then use getchars to start at that string, the position is wrong and you do not get the expected results. Sure would be nice to have some consistency in the way these text manipulation contexts work. But since that's not possible, it would be handy to have this little tidbit of info in the docs. The work-around is apparently to strip out all the linefeeds from the source string before using findstring. Then findstring will locate the correct position in the source, and getchars will start at that position. Similar issues might exist with carriage returns and/or tabs. Regards, Kenneth Grome WebDNA Solutions http://www.webdnasolutions.com Web Database Systems and Linux Server Management On 10/24/2014 01:54 PM, Kenneth Grome wrote: > Does FindString always fail when using it on a string that > contains carriage returns or line feeds or some other characters > commonly found in XML documents? > > The reason I ask is because it's not locating the correct > character position in my XML document, so I'm guessing there's an > undocumented bug here. > > Have any of you had this experience in the past? > > Regards, > Kenneth Grome > WebDNA Solutions > http://www.webdnasolutions.com > Web Database Systems and Linux Server Management > Associated Messages, from the most recent to the oldest:

    
  1. [WebDNA] FindString fails ... but why? (Kenneth Grome 2014)
Never mind, I figured it out: FindString ignores linefeed characters whereas getchars does not -- so when you use findstring to locate the position of a string in a source with linefeeds in it, and then use getchars to start at that string, the position is wrong and you do not get the expected results. Sure would be nice to have some consistency in the way these text manipulation contexts work. But since that's not possible, it would be handy to have this little tidbit of info in the docs. The work-around is apparently to strip out all the linefeeds from the source string before using findstring. Then findstring will locate the correct position in the source, and getchars will start at that position. Similar issues might exist with carriage returns and/or tabs. Regards, Kenneth Grome WebDNA Solutions http://www.webdnasolutions.com Web Database Systems and Linux Server Management On 10/24/2014 01:54 PM, Kenneth Grome wrote: > Does FindString always fail when using it on a string that > contains carriage returns or line feeds or some other characters > commonly found in XML documents? > > The reason I ask is because it's not locating the correct > character position in my XML document, so I'm guessing there's an > undocumented bug here. > > Have any of you had this experience in the past? > > Regards, > Kenneth Grome > WebDNA Solutions > http://www.webdnasolutions.com > Web Database Systems and Linux Server Management > 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:

Pithy questions on webcommerce & siteedit (1997) [WebDNA] mac osx permissions problem (2010) Plugin or CGI or both (1997) Virtual hosting and webcatNT (1997) WebCatalog can't find database (1997) Browser Problem?!? POST forms and NN 4.0+ browsers (1997) Stuck (2003) ListFiles and .DS_Store (2004) Re:quit command on NT (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Misunderstanding?? (1997) request for string functions (1998) [BULK] [WebDNA] [BULK] which of these tags exist in 7.0 (2011) Logging purchases (1997) [addlineitems] (1997) [WebDNA] Docs Update (2015) File Upload, Browser Timeout (2003) Creditcard verification with WebCat (1998) WebCat2 beta 11 - new prefs ... (1997) [TaxableTotal] - not working with AOL and IE (1997)