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:
New servers and new inline cache (1997)
NT vs Mac (1997)
[OT] On a side note.. (2003)
[setlineitem] unable to set sku? (1999)
Banners and sort of random display (1997)
Million product store (2003)
read and write you own cookies with webcat (1997)
[WebDNA] OT - JS help (2008)
Setting up shop (1997)
[OT] XServe networking PITA (2004)
Updating a database once per day - An example (1998)
Re:Emailer and encryption (1997)
Emailer setup (1997)
Can webcat 3.0/4.0 handle 1,000,000 hits a day? (2000)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Trouble with my database (1998)
How can I record purchases to a database? (1998)
read and write you own cookies with webcat (1997)
Error 11 (1996)
PCS Frames (1997)