[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 stringin a source with linefeeds in it, and then use getchars to startat that string, the position is wrong and you do not get theexpected results.Sure would be nice to have some consistency in the way these textmanipulation contexts work. But since that's not possible, itwould be handy to have this little tidbit of info in the docs.The work-around is apparently to strip out all the linefeeds fromthe source string before using findstring. Then findstring willlocate the correct position in the source, and getchars will startat that position.Similar issues might exist with carriage returns and/or tabs.Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server ManagementOn 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:
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 stringin a source with linefeeds in it, and then use getchars to startat that string, the position is wrong and you do not get theexpected results.Sure would be nice to have some consistency in the way these textmanipulation contexts work. But since that's not possible, itwould be handy to have this little tidbit of info in the docs.The work-around is apparently to strip out all the linefeeds fromthe source string before using findstring. Then findstring willlocate the correct position in the source, and getchars will startat that position.Similar issues might exist with carriage returns and/or tabs.Regards,Kenneth GromeWebDNA Solutionshttp://www.webdnasolutions.comWeb Database Systems and Linux Server ManagementOn 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)