Re: detecting if var is blank?
This WebDNA talk-list message is from 2007
It keeps the original formatting.
numero = 68363
interpreted = N
texte = if you put the [raw][myvar][/raw] as the left side argument then you won't have to worry about the value of myvar messing up the comparison (if myvar is "=34" then you'll get odd results - which is why it's usally best to [url]ize each side of the comparison). I usually do this:[showif [raw][myvar][/raw]=[myvar]][text]myvar=[/text][/text][/showif]then you can be assured that myvar is valid later on...[showif [url][myvar][/url]=]...[/showif]>[hideif [myvar]=[raw][myvar][/raw]]>[hideif [myvar]=]>Only shows if the variable is not blank or undefined>[/hideif][/hideif]>>>You can do this cleaner with an IF statement but figured you might want to>stay with hideifs/showifs>>>HTH>Alex>>>>>>On 1/25/07 3:11 PM, "Scott Szretter"
wrote:>>> I am hoping someone can tell me why this is not working:>> >> I am trying to show text and a variable only if it is actually preset>> and contains something.>> Both lines of code below produce this:>> >> abc:[myvar]>> >> Here are the two ways I have tried:>> >> 1.>> [showif [myvar]!]abc:[myvar]>> [/showif]>> >> 2.>> [showif [myvar]![blank]]abc:[myvar][/showif]>> >> >> Any ideas?>> Thanks!>>-- >Alex McCombie >. . . . . . . . . . . . . . . . . . . . . . . . . . . .>Adventure Skies Interactive>Box 124>Martville, NY 131111>p. 315 .233 .9403 >e. Alex@AdventureSkies.com>>http://AdventureSkies.com>>>>>------------------------------------------------------------->This message is sent to you because you are subscribed to> the mailing list .>To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://webdna.smithmicro.com/-- --------------------------------- John A. Hill Oak Hill SoftwareWebsite Development/Consulting john@oakhillsoftware.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
if you put the [raw][myvar][/raw] as the left side argument then you won't have to worry about the value of myvar messing up the comparison (if myvar is "=34" then you'll get odd results - which is why it's usally best to [url]ize each side of the comparison). I usually do this:[showif [raw][myvar][/raw]=[myvar]][text]myvar=[/text][/text][/showif]then you can be assured that myvar is valid later on...[showif [url][myvar][/url]=]...[/showif]>[hideif [myvar]=[raw][myvar][/raw]]>[hideif [myvar]=]>Only shows if the variable is not blank or undefined>[/hideif][/hideif]>>>You can do this cleaner with an IF statement but figured you might want to>stay with hideifs/showifs>>>HTH>Alex>>>>>>On 1/25/07 3:11 PM, "Scott Szretter" wrote:>>> I am hoping someone can tell me why this is not working:>> >> I am trying to show text and a variable only if it is actually preset>> and contains something.>> Both lines of code below produce this:>> >> abc:[myvar]>> >> Here are the two ways I have tried:>> >> 1.>> [showif [myvar]!]abc:[myvar]>> [/showif]>> >> 2.>> [showif [myvar]![blank]]abc:[myvar][/showif]>> >> >> Any ideas?>> Thanks!>>-- >Alex McCombie >. . . . . . . . . . . . . . . . . . . . . . . . . . . .>Adventure Skies Interactive>Box 124>Martville, NY 131111>p. 315 .233 .9403 >e. Alex@AdventureSkies.com>>http://AdventureSkies.com>>>>>------------------------------------------------------------->This message is sent to you because you are subscribed to> the mailing list .>To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >Web Archive of this list is at: http://webdna.smithmicro.com/-- --------------------------------- John A. Hill Oak Hill SoftwareWebsite Development/Consulting john@oakhillsoftware.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
John Hill
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:
Problems with [Applescript] (1997)
blank page from template (1997)
Items XX to XX shown (1997)
Missing Cart Information (2003)
encrypt (2000)
Three new problems, maybe a fourth (1997)
Not really WebCat (1997)
[WAY OFF TOPIC] anybody live in Kansas? (2003)
Hello??? (1997)
WebCatalog for guestbook ? (1997)
Odd search results, or odd programmer, not sure which... (2002)
[WebDNA] anyone use curl with shell? (2010)
Reversed words (1997)
Dates (1996)
RE: ANother SHOWIF problem (1997)
auto enter dates (1998)
Re:emailer 150 (1997)
Feature req. (2002)
Search in 2 or more catalogs (1997)
Fields/Forms Processing (1998)