Re: [defined]ish

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13520
interpreted = N
texte = >if there's a [name] field, display [name] >if there's an [item] field, display [item] > >To me, this is analogous to check for the variable... However, it >would seem to require a WebDNA tag along the lines of [defined >[name]], and nothing similar seems to exist.If you set a variable fred=12, then using [fred] will display 12. If a variable named fred does not exist, then [fred] will display literally [fred]. This is done purposely so that web pages with text button-bars won't mess up: [ Home | About Us | Guestbook ] should display as plain text even though it has those [ in it.So to check for the 'non-existence' of a variable, you can just check to see if its value is the same as its raw text:[showif [fred]=[raw][fred][/raw]]...variable fred doesn't exist[/showif]Notice you need the [raw] context because [showif [fred]=[fred]] will always be true: [showif 12=12] or [showif [fred]=[fred]] is always true.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Associated Messages, from the most recent to the oldest:

    
  1. Re: [defined]ish (a.h.s. boy 1997)
  2. Re: [defined]ish (Grant Hulbert 1997)
  3. Re: [defined]ish (Christer Olsson 1997)
  4. Re: [defined]ish (a.h.s. boy 1997)
  5. Re: [defined]ish (Kenneth Grome 1997)
  6. Re: [defined]ish (Christer Olsson 1997)
  7. [defined]ish (a.h.s. boy 1997)
>if there's a [name] field, display [name] >if there's an [item] field, display [item] > >To me, this is analogous to check for the variable... However, it >would seem to require a WebDNA tag along the lines of [defined >[name]], and nothing similar seems to exist.If you set a variable fred=12, then using [fred] will display 12. If a variable named fred does not exist, then [fred] will display literally [fred]. This is done purposely so that web pages with text button-bars won't mess up: [ Home | About Us | Guestbook ] should display as plain text even though it has those [ in it.So to check for the 'non-existence' of a variable, you can just check to see if its value is the same as its raw text:[showif [fred]=[raw][fred][/raw]]...variable fred doesn't exist[/showif]Notice you need the [raw] context because [showif [fred]=[fred]] will always be true: [showif 12=12] or [showif [fred]=[fred]] is always true.Grant Hulbert, V.P. Engineering | ===== Tools for WebWarriors ===== Pacific Coast Software | WebCatalog Pro, WebCommerce Solution 11770 Bernardo Plaza Court | SiteEdit Pro, SiteCheck, PhotoMaster San Diego, CA 92128 | SiteGuard 619/675-1106 Fax: 619/675-0372 | http://www.smithmicro.com Grant Hulbert

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:

database problems (1999) Running a store on BOTH http and https (1998) Practice runs ? (1997) Archives... (1997) Special delete ... (1997) RequiredFields template (1997) WebDNA Solutions ... sorry! (1997) Loosing Quantity (2000) Re:2.1 pricing? (1998) Keep away (1997) Using Plug-In while running 1.6.1 (1997) I am dumb. No see [variable] (2003) WebCat2b15MacPlugin - [protect] (1997) the dreaded unitShipCost (2003) Math (1997) Invisible file issue now a real 'bug' (1999) [ShowNext] feature in 2.0 (1997) [trim]?! (2004) [WebDNA] Encode cookies ONLY via "method=Base64" (2012) F*** you (1998)