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:
Problems getting parameters passed into email. (1997)
RE:DatabaseHelper (1997)
WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997)
ASP and WebCatalog ?? (2000)
Expiration of Carts (1997)
includes and cart numbers (1997)
Ooops-Serial Number for NT (1997)
Need help with [cart] (2000)
Return records from another (1997)
Version 2.0 and 1.6 simultaneous (1997)
Searching multiple fields from one form field (1997)
WebCatalog Programmer looking for a new job (2001)
Need help with search title (1998)
WebCatalog2 Feature Feedback (1996)
WC2b15 File Corruption (1997)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
Quickie question on the email templates (1997)
Webstar 1.3.1 PPC (1997)
Forbidden CGI Error (1997)
Another bug to squash (WebCat2b13 Mac .acgi) (1997)