Re: [defined]ish
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13518
interpreted = N
texte = On the subject of Re: [defined]ish hath scrawled Kenneth Grome:>WebDNA'd pages only look for what you tell them to look for. If>there's a possibility that a particular variable *might* have been>passed or *should* have been passed, then you probably want to look>for that variable unless you're just passing it on to the next page>in the sequence.>>When someone hits the page directly, the [referrer] tag would not>have Macintouch in it (or whatever else you're looking for in the>referrer) so there would be no [referrer] and the test in your showif>context would fail, thus the showif stuff would NOT be executed.>>>Where would the refferer variable be, or how would I deal with>>it being undefined?>>That's why you use [showif] contexts ... to do something special when>the correct referrer is used ... and to NOT do those things when a>different referrer is used.This doesn't really answer the question...let me explain further, usinga clearer example. It's oversimplified, but should emphasize my point.I'm trying to deal with variables whose value could never be known tome in advance, and therefore I can't check them against possible values.Let's say you have a page called logon.tmpl. It contains a simpleform that prompts you for your name, and will link you to a news page(news.tmpl) that greets you by name. This banal form executes a URLlike news.tmpl$showpage?name=[name]The news.tmpl page contains Welcome, [name]! Want some news today, [name]?(Goofy examples are born of simplifications.) However, it's possiblethat some clever devil might skip the logon page, and simply hitnews.tmpl, which would leave the [name] variable undefined. Orrather, WebCatalog wouldn't consider [name] to be a variable at all,despite the brackets.I'd like to be able to trap for such an error, rather than leaving[name] in raw text. However, since [name] could be _any_ name, Isimply cannot do a [showif] context for an infinite number of possiblenames. So I'd like to be able to say [showif [name]=] Welcome, stranger! Why don't you hit logon.tmpl and give me your name? [/showif]I'm aware, though, that in WebDNA, an undefined variable is NOTequivalent to the empty string, but there doesn't seem to be ANY sortof token that an undefined variable _is_ equivalent to. If a variableis undefined, WebCatalog just treats it like a string that happens tohave brackets around it.In other words, what I'd like to do seems impossible. Is it?Considering potential problems with making the empty string a standinfor undefined, what I'd _like_ to see is a context like [showif [undefined[name]]] You haven't given me your name! [/showif]Make sense?spud. ------------------------------------------------------------------------- a.h.s. boy ---------------------- manifesto overlord, dada typographics spud@nothingness.org ------- http://www.nothingness.org/Now featuring Social Anarchism and the Situationist International archives J'suis l'enfant de l'etat, et je me bats contre ca
Associated Messages, from the most recent to the oldest:
On the subject of Re: [defined]ish hath scrawled Kenneth Grome:>WebDNA'd pages only look for what you tell them to look for. If>there's a possibility that a particular variable *might* have been>passed or *should* have been passed, then you probably want to look>for that variable unless you're just passing it on to the next page>in the sequence.>>When someone hits the page directly, the
[referrer] tag would not>have Macintouch in it (or whatever else you're looking for in the>referrer) so there would be no
[referrer] and the test in your showif>context would fail, thus the showif stuff would NOT be executed.>>>Where would the refferer variable be, or how would I deal with>>it being undefined?>>That's why you use
[showif] contexts ... to do something special when>the correct referrer is used ... and to NOT do those things when a>different referrer is used.This doesn't really answer the question...let me explain further, usinga clearer example. It's oversimplified, but should emphasize my point.I'm trying to deal with variables whose value could never be known tome in advance, and therefore I can't check them against possible values.Let's say you have a page called logon.tmpl. It contains a simpleform that prompts you for your name, and will link you to a news page(news.tmpl) that greets you by name. This banal form executes a URLlike news.tmpl$showpage?name=[name]The news.tmpl page contains Welcome, [name]! Want some news today, [name]?(Goofy examples are born of simplifications.) However, it's possiblethat some clever devil might skip the logon page, and simply hitnews.tmpl, which would leave the [name] variable undefined. Orrather, WebCatalog wouldn't consider [name] to be a variable at all,despite the brackets.I'd like to be able to trap for such an error, rather than leaving[name] in raw text. However, since [name] could be _any_ name, Isimply cannot do a
[showif] context for an infinite number of possiblenames. So I'd like to be able to say [showif [name]=] Welcome, stranger! Why don't you hit logon.tmpl and give me your name? [/showif]I'm aware, though, that in WebDNA, an undefined variable is NOTequivalent to the empty string, but there doesn't seem to be ANY sortof token that an undefined variable _is_ equivalent to. If a variableis undefined, WebCatalog just treats it like a string that happens tohave brackets around it.In other words, what I'd like to do seems impossible. Is it?Considering potential problems with making the empty string a standinfor undefined, what I'd _like_ to see is a context like [showif [undefined[name]]] You haven't given me your name! [/showif]Make sense?spud. ------------------------------------------------------------------------- a.h.s. boy ---------------------- manifesto overlord, dada typographics spud@nothingness.org ------- http://www.nothingness.org/Now featuring Social Anarchism and the Situationist International archives J'suis l'enfant de l'etat, et je me bats contre ca
a.h.s. boy
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:
Adding a product from another site (1997)
WebCat2 beta 11 - new prefs ... (1997)
More on the email templates (1997)
wierd crashes for multi-sendmails on NT (1997)
WebCat2b13MacPlugIn - [include] (1997)
Some Questions (1997)
WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997)
Upcoming 2.1 Release and PCS Committment (1997)
Simple way to create unique SKU (1997)
Getting Total Quantity (1997)
DNA Bandwidth Monitor (2005)
Re2: frames & carts (1997)
multi-paragraph fields (1997)
[WebDNA] Processor Maxing out (2010)
Searching an Email database (1997)
shipcost vs shiptotal (1998)
no global [username] or [password] displayed ... (1997)
Highlighting words found in a keyword search (2003)
Multiple transactions per cart (2000)
stopping/restarting service on NT? (1998)