Re: apparent variable variable display?

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 31314
interpreted = N
texte = In Perl, this would be the difference between defined and exists. In your case, [Header40] is always defined (when in an order context). The test [showif [header40]=] should do what you want. Only if a variable has never been defined (i.e. never used) will [Header1]=[raw][Header1][/raw]be trueJohn PeacockJohn Butler wrote: > > I finding something inconsistent, tho it might be my brain...? > I want to do something if one of the orderfile headers has not yet been given a value. > I have successfully been using this- > > [showif [Header1]=[raw][Header1][/raw]] > do stuff > [/showif] > > But when I stick this on my template- > > Header40=[Header40] > > Then it returns- > Header40= > > so which is it? Do undefined orderfile headers display as the null string (like empty > db fields), or do they display as uninitialized vars, like [somevar]? > If the former then why does my showif above evaluate to true? > > -John > > ------------------------------------------------------------- > 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 ------------------------------------------------------------- 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 Associated Messages, from the most recent to the oldest:

    
  1. Re: apparent variable variable display? (John Butler 2000)
  2. Re: apparent variable variable display? (John Butler 2000)
  3. Re: apparent variable variable display? (John Peacock 2000)
  4. Re: apparent variable variable display? (John Butler 2000)
  5. Re: apparent variable variable display? (John Peacock 2000)
  6. Re: apparent variable variable display? (Rob Marquardt 2000)
  7. apparent variable variable display? (John Butler 2000)
  8. Re: apparent variable variable display? (John Peacock 2000)
  9. Re: apparent variable variable display? (Scott Tolley 2000)
In Perl, this would be the difference between defined and exists. In your case, [Header40] is always defined (when in an order context). The test [showif [header40]=] should do what you want. Only if a variable has never been defined (i.e. never used) will [Header1]=[raw][Header1][/raw]be trueJohn PeacockJohn Butler wrote: > > I finding something inconsistent, tho it might be my brain...? > I want to do something if one of the orderfile headers has not yet been given a value. > I have successfully been using this- > > [showif [Header1]=[raw][Header1][/raw]] > do stuff > [/showif] > > But when I stick this on my template- > > Header40=[Header40] > > Then it returns- > Header40= > > so which is it? Do undefined orderfile headers display as the null string (like empty > db fields), or do they display as uninitialized vars, like [somevar]? > If the former then why does my showif above evaluate to true? > > -John > > ------------------------------------------------------------- > 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 ------------------------------------------------------------- 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 John Peacock

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:

Custom formulas.db (1998) WebCatalog can't find database (1997) USPS change to SSL tcpconnect (2007) Public beta 5 of WebCatalog 4.0 is now available (2000) shared_POP and archiving your own mailing list (2003) WebCatalog for Mac 2.0.1 Released (1997) Multiple prices (1997) New user...how do I create URLs from form fields? (2000) autosensing lanague selection (1997) If search results are blank... (2003) Is there a max number of fields? (1998) searchable list archive (1997) Who is doing sign-ups (1998) MacAuthorize order data fields WAS:How To question... (1997) No luck with taxes (1997) [WebDNA] What does PHP(5) has, that Webdna hasn't (2009) [addlineitems] display (1997) Add to a filename in multifile upload (2002) Dates as 20020902 (2002) Performance of this mailserver (2000)