Re: apparent variable variable display?
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 31321
interpreted = N
texte = The cart header values are only available inside an orderfile context. If your test is not inside an orderfile context, you are not looking inthe right place.Put [orderfile ShoppingCarts/[cart]] around your test and see if that changes it. You can also make the previous link include somefile.tpl?command=showcartand that will put you in an implied orderfile context.John Butler wrote:> > 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?> > -John> > John 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 -------------------------------------------------------------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:
The cart header values are only available inside an orderfile context. If your test is not inside an orderfile context, you are not looking inthe right place.Put [orderfile ShoppingCarts/[cart]] around your test and see if that changes it. You can also make the previous link include somefile.tpl?command=showcartand that will put you in an implied orderfile context.John Butler wrote:> > 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?> > -John> > John 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 -------------------------------------------------------------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:
WCS Newbie question (1997)
No one gets my client's code for free ... (2005)
Include a big block of text (1997)
Experience with creating real dynamic solutions?????? (1998)
Sort Order on a page search (1997)
WebCat2 - many [carts] on one template page? (1997)
Formvars in a formula? (2000)
TCP Connect (2000)
[ShowNext] (1997)
database freeze (1997)
Multi vendor shop (2000)
WebCommerce: Folder organization ? (1997)
Ads.db (1997)
[WebDNA] Error. WebDNA (version 5.1g or later) is not running. (2013)
delete fails (2000)
code to phantom spacing (2001)
AOL and referrers on target=_blank (2000)
Plugin or CGI or both (1997)
Country & Ship-to address & other fields ? (1997)
Beta Documentation (1997)