Re: [ShowIf] if the varieable exists
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 20317
interpreted = N
texte = >I understand that normally you would put the [ShowIf] context followed>by the equation.>ex: [ShowIf [wogroup1datarq]=Mustang]Car[/ShowIf]>However, there will not always be an existing variable called>[wogroup1datarq]. Instead, I would like to [ShowIf] if the variable>[wogroup1datarq] exists. How can I do this? [showif [wogroup1datarq]![raw][wogroup1datarq][/raw]]This will showif the variable exists. If you reference a variable inWebCatalog that does not exist, then you just get it right backatcha. i.e. If you say [bob] but there is no variable bob, then it will just return[bob]. Surrounding a variable declaration (i.e. [bob] ) in [raw] tagsreturns it untouched, so then you are checking on the right side of theequation to see if the left side returned an actual value, or wasn't foundto be a variable and just returned the name of the variable back inbrackets. Likewise, if you want to do somethign when the variable doesn'texist: [showif [wogroup1datarq]=[raw][wogroup1datarq][/raw]]Howard Wolosky============Lead Programmer / Webmaster www.willitwork.comWill It Work presented by Lab 2k -The World's Largest Year 2000 Compliance Seach Engine
Associated Messages, from the most recent to the oldest:
>I understand that normally you would put the
[showif] context followed>by the equation.>ex: [ShowIf [wogroup1datarq]=Mustang]Car[/ShowIf]>However, there will not always be an existing variable called>[wogroup1datarq]. Instead, I would like to
[showif] if the variable>[wogroup1datarq] exists. How can I do this? [showif [wogroup1datarq]!
[raw][wogroup1datarq][/raw]]This will showif the variable exists. If you reference a variable inWebCatalog that does not exist, then you just get it right backatcha. i.e. If you say [bob] but there is no variable bob, then it will just return[bob]. Surrounding a variable declaration (i.e. [bob] ) in
[raw] tagsreturns it untouched, so then you are checking on the right side of theequation to see if the left side returned an actual value, or wasn't foundto be a variable and just returned the name of the variable back inbrackets. Likewise, if you want to do somethign when the variable doesn'texist: [showif [wogroup1datarq]=
[raw][wogroup1datarq][/raw]]Howard Wolosky============Lead Programmer / Webmaster www.willitwork.comWill It Work presented by Lab 2k -The World's Largest Year 2000 Compliance Seach Engine
Howard Wolosky
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:
founditems (1998)
Sorting by date (1997)
Email Obfuscation Function (2008)
WebCat2b12plugin - [search] is broken ... not! (1997)
[WebDNA] Crashing Database (2011)
sendmail error (2001)
AOL and referrers on target=_blank (2000)
[WebDNA] Make a php page into webdna version (2018)
[convertchars] problem... (2000)
HomePage Caution (1997)
WebCat2b15MacPlugin - showing [math] (1997)
Now you see it now you donīt (1997)
Ken's Data Manager (finally available I think ...) (2005)
Mac vs. Unix Line Endings (2002)
Compressed cookies? (2003)
Help with Shipping Costs (1997)
WebCatalog stalls (1998)
[numfound] within summ=t ??? (2000)
Showif -what am I missing??? (1999)
[append] vs. [appendfile] delta + question? (1997)