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:
Outsourcing partnership ... (2005)
Emailer (1997)
shownext problems (1998)
Shopping Cart ID (1998)
newbie Q: [cart] documentation (1999)
Re:redirect from the errorsMessages.db entry (1997)
[WebDNA] Only one request at a time? (2011)
Permissions (2000)
WebCat2b12 CGI Mac - [shownext] problem (1997)
WebCatalog for guestbook ? (1997)
WebCat and image maps (1997)
OSX SubAdmin Templates (2000)
Not reading code (1997)
maximu values for sendmail! (1997)
Where's Cart Created ? (1997)
is there a [purchase]? (1998)
Extended [ConvertChars] (1997)
Server replication (1998)
Satisfy Me ! was: Why can't support be satisfying to purchasers? (2000)
WebCatalog2 Feature Feedback (1996)