Re: apparent variable variable display?

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 31322
interpreted = N
texte = John that makes total sense, but then why does-[showif [Header1]=[raw][Header1][/raw]] > do stuff > [/showif]do the stuff?!! I swear it does, and when I set that header I use- [SetHeader cart=[cart]]Header1=[free][/SetHeader]...so that eliminates the chance that I have given Header1 a literal value of [Header1] (plus I just opened the orderfile with a text editor and the value of Header1 is 0)I don't understand how that showif can be true, but it is somehow. The exact code (on a SSL page, Linux, webcat 3.08) is-[!]=======Do this if IE is force reloading this page from the server when user hits back/forward button, then javascript jumps back a page =======[/!] [showif [Header1]=[raw][Header1][/raw]] [/showif]could you try it as I have it?-JohnJohn Peacock wrote:> 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 true > > John Peacock > > John 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 ------------------------------------------------------------- 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)
John that makes total sense, but then why does-[showif [Header1]=[raw][Header1][/raw]] > do stuff > [/showif]do the stuff?!! I swear it does, and when I set that header I use- [SetHeader cart=[cart]]Header1=[free][/SetHeader]...so that eliminates the chance that I have given Header1 a literal value of [Header1] (plus I just opened the orderfile with a text editor and the value of Header1 is 0)I don't understand how that showif can be true, but it is somehow. The exact code (on a SSL page, Linux, webcat 3.08) is-[!]=======Do this if IE is force reloading this page from the server when user hits back/forward button, then javascript jumps back a page =======[/!] [showif [Header1]=[raw][Header1][/raw]] [/showif]could you try it as I have it?-JohnJohn Peacock wrote:> 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 true > > John Peacock > > John 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 ------------------------------------------------------------- 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 Butler

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:

Nested tags count question (1997) QuitFeedback & DBNotOpened errors (1997) shipcost (1997) Banner DNA (1997) OT - help.. (2003) Can this be done? (1997) WebCatalog for guestbook ? (1997) WebDNA Codes in Secure Mode (1997) RE: Automatic thumbnail images (1998) Formating found categories (1997) Linux problems (2000) The evolved Server Configuration Queston (2000) WCS Newbie question (1997) 2 databases problem (1997) php vs WebCatalog (2000) Databases (2000) Sorry I didn't pay attention-but ??? (1997) BBedit glossary for WebCat? (2000) Serving images from databases (1998) Webstar 1.3.1 PPC (1997)