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 at all. Submitting Name= sets the value of Name to nothing. But if you neglect to set the value of name to nothing, then WebCat interprets the 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 unless you actually set it to equal nothing, and you haven't bothered to do that.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 tag value of [name] (without the quotes) for the comparison. And since the 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 the first place? Where do you expect to get a value for [name] if you're not passing it in the URL from the previous page? If there's never a possibility of [name] getting a value from somewhere, you don't even need the [showif] ... :)Sincerely, Ken Grome WebDNA Solutions http://www.hui.net/dna/webdna.html Associated Messages, from the most recent to the oldest:

    
  1. Re: [SHOWIF]s and empty arguments (Trevor Crist 1997)
  2. Re: [SHOWIF]s and empty arguments (Michael Winston 1997)
  3. Re: [SHOWIF]s and empty arguments (Kenneth Grome 1997)
  4. Re: [SHOWIF]s and empty arguments (Michael Winston 1997)
  5. [SHOWIF]s and empty arguments (Michael Winston 1997)
>>>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 at all. Submitting Name= sets the value of Name to nothing. But if you neglect to set the value of name to nothing, then WebCat interprets the 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 unless you actually set it to equal nothing, and you haven't bothered to do that.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 tag value of [name] (without the quotes) for the comparison. And since the 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 the first place? Where do you expect to get a value for [name] if you're not passing it in the URL from the previous page? If there's never a possibility of [name] getting a value from somewhere, you don't even need the [showif] ... :)Sincerely, Ken Grome WebDNA Solutions http://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:

Hyperboard/bulletin board available (1998) WebCat2b15MacPlugin - showing [math] (1997) Help! WebCat2 bug (1997) Re[2]: WebCatalog 3.0.8 Mac OS (2000) WebCatalog NT beta 18 now available (1997) Preventing Merchant Settling ? (1997) docs for WebCatalog2 (1997) Webcatalog [blank] Problem (1999) Question re: FlushDatabases (1997) remotely add + sign (1997) [WebDNA] WebDNA Crashing or Not (2008) OT: WebDNA and LINUX (2004) [WebDNA] Just drop the Server version (2015) [OT] See Flash? (2003) [WebDNA] Cent 7 - FCGI version 8.5 - NGINX (2016) Where is f2? (1997) A quickie question (1997) Tiny Store (1998) [WebDNA] jumpstart me? - how to auto-upload to a remote server? (2010) How is it done? (1998)