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:

shoppingcart reload qty (1997) What am I missing (1997) Problems with ErrorLog on Linux (2000) WCS Newbie question (1997) [/application] error? (1997) Re:Help name our technology! (1997) Same Cart # Problem... (2000) [SHOWIF] (1997) WebCat and AppleShare 6.0 (1998) Preloading code? (2002) multi-paragraph fields (1997) lookup command (1999) HTML E-mails demystified (2002) format_to_days on NT (1997) StoreBuilder Shopping Cart (2000) File Uploads... (1997) canEmail? (1998) WebCat2 several catalogs? (1997) authorizenet and netscape (2002) f2 download problems (1997)