Re: [SHOWIF]s and empty arguments
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13199
interpreted = N
texte = >>>If I pass the URL http://www.mysite.com/CART=47646753675&STATUS=15>>>on to a page that has the WebDNA>>>>>>Welcome customer #[CART]!>>>You are [STATUS]th in line.>>>[SHOWIF [NAME]=]What is your name?[/SHOWIF]>>>>>>I want it to return:>>>>>>Welcome customer #47646753675!>>>You are 15th in line.>>>What is your name?>>>>>>However, the last line doesn't appear. Is this a bug or is my>>>logic all wrong?>> You are not passing any sort of value from the previous page to stand in>> for [Name].>>>> If you made your URL>> http://www.mysite.com/CART=47646753675&Name=&STATUS=15 it should work.>>>> Instead, WC is trying to interpret [NAME] as text rather than a value.>> (In this case )>Yeah, but... that's the point. Submitting Name= should be the same as not>submitting Name at all.No, Winston, this is where you are wrong and Trevor is correct.Submitting Name= is *NOT* the same as neglecting to submit a value atall. Submitting Name= sets the value of Name to nothing. But if youneglect to set the value of name to nothing, then WebCat interpretsthe name tag as its raw value, which is [name], not 'nothing'.>If I don't submit a value for Name, then [Name]>should be an empty string (). Empty is empty, right?No, no, no. The value of [name] can never be equal to nothing unlessyou actually set it to equal nothing, and you haven't bothered to dothat.If for any reason there is no value assigned to the [name] variable -which is exactly what you're doing here - WebCat uses the raw tagvalue of [name] (without the quotes) for the comparison. And sincethe raw value [name] is not equal to nothing, the stuff inside the[showif] context does not get displayed.In other words, WebCat is working exactly as it should.By the way, why do you even need the [showif] context there in thefirst place? Where do you expect to get a value for [name] if you'renot passing it in the URL from the previous page? If there's never apossibility of [name] getting a value from somewhere, you don't evenneed the [showif] ... :)Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Associated Messages, from the most recent to the oldest:
>>>If I pass the URL http://www.mysite.com/CART=47646753675&STATUS=15>>>on to a page that has the WebDNA>>>>>>Welcome customer #
[cart]!>>>You are [STATUS]th in line.>>>[SHOWIF [NAME]=]What is your name?[/SHOWIF]>>>>>>I want it to return:>>>>>>Welcome customer #47646753675!>>>You are 15th in line.>>>What is your name?>>>>>>However, the last line doesn't appear. Is this a bug or is my>>>logic all wrong?>> You are not passing any sort of value from the previous page to stand in>> for [Name].>>>> If you made your URL>> http://www.mysite.com/CART=47646753675&Name=&STATUS=15 it should work.>>>> Instead, WC is trying to interpret [NAME] as text rather than a value.>> (In this case )>Yeah, but... that's the point. Submitting Name= should be the same as not>submitting Name at all.No, Winston, this is where you are wrong and Trevor is correct.Submitting Name= is *NOT* the same as neglecting to submit a value atall. Submitting Name= sets the value of Name to nothing. But if youneglect to set the value of name to nothing, then WebCat interpretsthe name tag as its raw value, which is [name], not 'nothing'.>If I don't submit a value for Name, then [Name]>should be an empty string (). Empty is empty, right?No, no, no. The value of [name] can never be equal to nothing unlessyou actually set it to equal nothing, and you haven't bothered to dothat.If for any reason there is no value assigned to the [name] variable -which is exactly what you're doing here - WebCat uses the raw tagvalue of [name] (without the quotes) for the comparison. And sincethe raw value [name] is not equal to nothing, the stuff inside the
[showif] context does not get displayed.In other words, WebCat is working exactly as it should.By the way, why do you even need the
[showif] context there in thefirst place? Where do you expect to get a value for [name] if you'renot passing it in the URL from the previous page? If there's never apossibility of [name] getting a value from somewhere, you don't evenneed the
[showif] ... :)Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
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:
Sort Order on a page search (1997)
[WebDNA] Unofficial WebDna 6.2 and 7 - Mac Mavericks Installer (2014)
Date search - yes or no (1997)
Understanding texta (1997)
[WebDNA] v7 success story (2012)
[WebDNA] To be or not to be friendly (URLs) (2011)
How to Display text in empty fields (1997)
Great product and great job ! (1997)
Progress !! WAS: Trouble with formula.db (1997)
Where's Cart Created ? (1997)
Show shoppingcart after remove last item (1997)
Quit revisited (1997)
How Many SKU's is enough? (1997)
Formating found categories (1997)
Emailer (1997)
Associative lookup style? + bit more (1997)
Using Cookie for client specific info? (1997)
4.0.x find (2000)
Virtual hosting and webcatNT (1997)
webcat restarting script on Linux? (1999)