Re: Undeclared variables

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 57488
interpreted = N
texte = I count on my variables being secure - if the application does not require it, then I see no problem with that method at all. - charles On Apr 23, 2004, at 9:46 PM, Kenneth Grome wrote: > Yes but what's the point of avoiding them? They don't require any > appreciable overhead and they make coding much easier, right? > >> But then you have insecure variables :( >> >> On Apr 23, 2004, at 9:23 PM, Kenneth Grome wrote: >> >>>> Is there a more elegant way to do this: >>>> >>>> [showif [variable]=[raw][variable][/raw]]variable=some default >>>> value[/showif] >>>> >>>> Seems like using [raw] is a pretty kludgey way of determining if a >>>> variable is undefined. I've been doing this forever, and maybe in >>>> ver 6 there's a better way now? >>> >>> >>> There is a better way (in my opinion) and it's been around for ages, >>> you do not need v6, but it DOES require that you declare all the >>> vars you might be checking for at the TOP of the page like this: >>> >>> [text secure=f]var1=[/text] >>> [text secure=f]var2=[/text] >>> [text secure=f]var3=[/text] >>> >>> ... or like this: >>> >>> [text secure=f&multi=T]var1=&var2=&var3=[/text] >>> >>> This pre-sets them all to insecure variables with blank values. Then >>> you can just put the [var1] tag on the page and it will resolve to >>> blank or else it will resolve to whatever value it gets reset to >>> AFTER you preset it to blank at the top of the page. >>> >>> In other words, if the value is reset by an incoming formvariable or >>> by some webdna code in the page itself, it will resolve to that new >>> value. But if the value is not reset it will remain blank, which >>> means it is easy to check using showif's WITHOUT messing with raw or >>> url contexts. >>> >>> If you still need to check it first to see if it's blank before >>> using it, this is the easy-coding way to do it without raw or url: >>> >>> [showif =[var1]]the value is blank[/showif] >>> >>> [showif ![var1]]the value is not blank[/showif] >>> >>> This works because the comparison value on the left side of the >>> operator is blank, and the next char is the comparison operator, so >>> everything that follows is either blank or not. And since webdna >>> has already identified the comparison operator before it gets to the >>> var1 tag, you do not have to URL it like you would if you did it >>> like this instead: >>> >>> [showif [url][var1][/url]=]the value is blank[/showif] >>> >>> If you take advantage of this feature, you can write code faster >>> that still works as expected without introducing any problems. I >>> have been pre-setting my vars like this for years and it just works >>> ... >>> >>> -- >>> >>> Kenneth Grome >>> WebDNA Programmer >>> Outsource Service Provider >>> Phone: +6332 255-6591 >>> >>> ------------------------------------------------------------- >>> 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 >>> >>> Web Archive of this list is at: http://webdna.smithmicro.com/ >>> >> >> >> ------------------------------------------------------------- >> 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 >> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > > -- > > Kenneth Grome > WebDNA Programmer > Outsource Service Provider > Phone: +6332 255-6591 > > ------------------------------------------------------------- > 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 > > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Undeclared variables ( Brian Fries 2004)
  2. Re: Undeclared variables ( Rob Marquardt 2004)
  3. Re: Undeclared variables ( Alan White 2004)
  4. Re: Undeclared variables ( charles kline 2004)
  5. Re: Undeclared variables ( Alan White 2004)
  6. Re: Undeclared variables ( Terry Wilson 2004)
  7. Re: Undeclared variables ( "WebDna @ Inkblot Media" 2004)
  8. Re: Undeclared variables ( Kenneth Grome 2004)
  9. Re: Undeclared variables ( charles kline 2004)
  10. Re: Undeclared variables ( Kenneth Grome 2004)
  11. Re: Undeclared variables ( charles kline 2004)
  12. Re: Undeclared variables ( Kenneth Grome 2004)
  13. Re: Undeclared variables ( devaulw@onebox.com 2004)
  14. Re: Undeclared variables ( charles kline 2004)
  15. Re: Undeclared variables ( Rob Marquardt 2004)
  16. Undeclared variables ( Terry Wilson 2004)
I count on my variables being secure - if the application does not require it, then I see no problem with that method at all. - charles On Apr 23, 2004, at 9:46 PM, Kenneth Grome wrote: > Yes but what's the point of avoiding them? They don't require any > appreciable overhead and they make coding much easier, right? > >> But then you have insecure variables :( >> >> On Apr 23, 2004, at 9:23 PM, Kenneth Grome wrote: >> >>>> Is there a more elegant way to do this: >>>> >>>> [showif [variable]=[raw][variable][/raw]]variable=some default >>>> value[/showif] >>>> >>>> Seems like using [raw] is a pretty kludgey way of determining if a >>>> variable is undefined. I've been doing this forever, and maybe in >>>> ver 6 there's a better way now? >>> >>> >>> There is a better way (in my opinion) and it's been around for ages, >>> you do not need v6, but it DOES require that you declare all the >>> vars you might be checking for at the TOP of the page like this: >>> >>> [text secure=f]var1=[/text] >>> [text secure=f]var2=[/text] >>> [text secure=f]var3=[/text] >>> >>> ... or like this: >>> >>> [text secure=f&multi=T]var1=&var2=&var3=[/text] >>> >>> This pre-sets them all to insecure variables with blank values. Then >>> you can just put the [var1] tag on the page and it will resolve to >>> blank or else it will resolve to whatever value it gets reset to >>> AFTER you preset it to blank at the top of the page. >>> >>> In other words, if the value is reset by an incoming formvariable or >>> by some webdna code in the page itself, it will resolve to that new >>> value. But if the value is not reset it will remain blank, which >>> means it is easy to check using showif's WITHOUT messing with raw or >>> url contexts. >>> >>> If you still need to check it first to see if it's blank before >>> using it, this is the easy-coding way to do it without raw or url: >>> >>> [showif =[var1]]the value is blank[/showif] >>> >>> [showif ![var1]]the value is not blank[/showif] >>> >>> This works because the comparison value on the left side of the >>> operator is blank, and the next char is the comparison operator, so >>> everything that follows is either blank or not. And since webdna >>> has already identified the comparison operator before it gets to the >>> var1 tag, you do not have to URL it like you would if you did it >>> like this instead: >>> >>> [showif [url][var1][/url]=]the value is blank[/showif] >>> >>> If you take advantage of this feature, you can write code faster >>> that still works as expected without introducing any problems. I >>> have been pre-setting my vars like this for years and it just works >>> ... >>> >>> -- >>> >>> Kenneth Grome >>> WebDNA Programmer >>> Outsource Service Provider >>> Phone: +6332 255-6591 >>> >>> ------------------------------------------------------------- >>> 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 >>> >>> Web Archive of this list is at: http://webdna.smithmicro.com/ >>> >> >> >> ------------------------------------------------------------- >> 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 >> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > > -- > > Kenneth Grome > WebDNA Programmer > Outsource Service Provider > Phone: +6332 255-6591 > > ------------------------------------------------------------- > 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 > > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- 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 Web Archive of this list is at: http://webdna.smithmicro.com/ charles kline

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:

WebCat on Intel Core 2 macs anyone? (2007) WCS Newbie question (1997) [lineitems] and [writefile] (1998) What am I doing wrong? (2000) 911: testing if the field is empty (2000) Color options for items (1999) Re:Emailer and encryption (1997) Serving images from databases (1998) Search/sort in URL Was: GuestBook example (1997) WebCat2 several catalogs? (1997) WebTen and WebCat (1997) unable to launch acgi in WebCat (1997) b12 cannot limit records returned and more. (1997) fresh eyes needed. Append won't work. (2000) mimeheaders to allow back button to work on a posted page? (2004) [WebDNA] HTTP Streaming -- impossible? (2010) [WebDNA] CSS Advice (2008) Not really WebCat (1997) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) WebDNA vs PHP (2003)