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 Software Website 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:

    
  1. Re: detecting if var is blank? ( Stuart Tremain 2007)
  2. Re: detecting if var is blank? ( Scott Szretter 2007)
  3. Re: detecting if var is blank? ( Donovan Brooke 2007)
  4. Re: detecting if var is blank? ( Donovan Brooke 2007)
  5. Re: detecting if var is blank? ( "Olin Lagon" 2007)
  6. Re: detecting if var is blank? ( John Hill 2007)
  7. Re: detecting if var is blank? ( Alex McCombie 2007)
  8. Re: detecting if var is blank? ( Gary Krockover 2007)
  9. detecting if var is blank? ( Scott Szretter 2007)
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 Software Website 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:

[WebDNA] ReturnRaw and binarybody (2013) The [shownext] limitations (2002) Alternating colors (1997) WebCat2b12 CGI Mac - [shownext] problem (1997) OT : Best book for OSX (2002) WebCatalog NT beta 18 now available (1997) What am I missing (1997) [WebDNA] inputed text getting scrambled up in DB (2012) Adding Header Values with [SetHeader] (1998) 'does not contain' operator needed ... (1997) RePost: NAT and the CART (1999) Multiple servers and Webcat (1998) WebCatalog can't find database (1997) NT BETA BUG???? (1997) Re:WebMerchant 3.0 for Mac shipping now (1998) access denied problem (1997) WC1.6 to WC2 date formatting (1997) Running _every_ page through WebCat ? (1997) Maximum of found items?? (2000) searching withe db up three directories not working (1999)