Re: Don't know if this is a sily question...

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 50772
interpreted = N
texte = That's a great coding tip and one I expect to use very often. Thanks Ken.-----Original Message----- From: Kenneth Grome Sent: Fri, 30 May 2003 01:18:00 To: (WebDNA Talk) Subject: Re: Don't know if this is a sily question...>As a related comment, using WebDNA 5 I find myself more often using >[function]s where I used to use [include]s to handle recurring >tasks. The formal use of parameters, the local scope variables, and >the ability to define functions within the page itself as well as in >a shared include file are compelling features. > >As a simple example: > >[function name=MyLink] >[return]db=....&value=[thevalue]&returnfield=ID]>[lookup >db=....&value=[thevalue]&returnfield=title]
[/return] >[/function] > >[search ...] >[founditems] >[MyLink thevalue=[whatever]] >[/founditems] >[/search] > >- brian I've been doing something similar for years, without v5's function context:[text]myLink=[raw][lookup db=....&value=[thevalue]&returnfield=title]
[/raw][/text][search ...] [founditems] [myLink] [/founditems] [/search]This has always been an easy way to create a variable once at the top of the page, and then use it any number of times further down on the same page -- while preventing the webdna code inside the text variable from being interpreted until the variable tag is used further down on the page -- such as inside the founditems context in this example. -- Sincerely, Kenneth Grome ------------------------------------------------------------- My programmers will write WebDNA code for you at $27 an hour! -------------------------------------------------------------------------------------------------------------------------- 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: Don't know if this is a sily question... (Phillip Bonesteele 2003)
  2. Re: Don't know if this is a sily question... (Kenneth Grome 2003)
  3. Re: Don't know if this is a sily question... (Brian Fries 2003)
  4. Re: Don't know if this is a sily question... (Kenneth Grome 2003)
  5. Re: Don't know if this is a sily question... (Kenneth Grome 2003)
  6. Re: Don't know if this is a sily question... (Brian Fries 2003)
  7. Re: Don't know if this is a sily question... (devaulw@onebox.com 2003)
  8. Re: Don't know if this is a sily question... (Kenneth Grome 2003)
  9. Re: Don't know if this is a sily question... (John Peacock 2003)
  10. Re: Don't know if this is a sily question... (Brian Fries 2003)
  11. Re: Don't know if this is a sily question... (Alex McCombie 2003)
  12. Re: Don't know if this is a sily question... (John Peacock 2003)
  13. Re: Don't know if this is a sily question... (Alex McCombie 2003)
  14. Re: Don't know if this is a sily question... (Bob Minor 2003)
  15. Re: Don't know if this is a sily question... (Alan White 2003)
  16. Re: Don't know if this is a sily question... (Alan White 2003)
  17. Re: Don't know if this is a sily question... (Alex McCombie 2003)
  18. Re: Don't know if this is a sily question... (John Peacock 2003)
  19. Re: Don't know if this is a sily question... (Alan White 2003)
That's a great coding tip and one I expect to use very often. Thanks Ken.-----Original Message----- From: Kenneth Grome Sent: Fri, 30 May 2003 01:18:00 To: (WebDNA Talk) Subject: Re: Don't know if this is a sily question...>As a related comment, using WebDNA 5 I find myself more often using >[function]s where I used to use [include]s to handle recurring >tasks. The formal use of parameters, the local scope variables, and >the ability to define functions within the page itself as well as in >a shared include file are compelling features. > >As a simple example: > >[function name=MyLink] >[return]db=....&value=[thevalue]&returnfield=ID]>[lookup >db=....&value=[thevalue]&returnfield=title]
[/return] >[/function] > >[search ...] >[founditems] >[MyLink thevalue=[whatever]] >[/founditems] >[/search] > >- brian I've been doing something similar for years, without v5's function context:[text]myLink=[raw][lookup db=....&value=[thevalue]&returnfield=title]
[/raw][/text][search ...] [founditems] [myLink] [/founditems] [/search]This has always been an easy way to create a variable once at the top of the page, and then use it any number of times further down on the same page -- while preventing the webdna code inside the text variable from being interpreted until the variable tag is used further down on the page -- such as inside the founditems context in this example. -- Sincerely, Kenneth Grome ------------------------------------------------------------- My programmers will write WebDNA code for you at $27 an hour! -------------------------------------------------------------------------------------------------------------------------- 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/ devaulw@onebox.com

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:

[ADDLINEITEM] hangs Web* (1998) Help name our technology! (1997) $adminput doesn't allow [include] files (1997) WebDNA EMail Preference (2005) Newbie problem blah blah blah (1997) Webcat2, WebCommerce, Mod 10 etc. (1997) Triggers Suck! (2000) SQL (2003) [/application] error? (1997) TRAINING videos - Prove IT. (1998) WebCat Error Log problem (2.0.1, acgi, Mac) (1997) [WebDNA] WebDNA Hosting (2008) Protect and Serve (1999) Webcat serving error page? (2000) using showpage and showcart commands (1996) Urgent WebCatalog problem (2000) Renaming textA (1998) Webcat 2.0.1 date math bug -> Crash! (1997) 'does not contain' operator needed ... (1997) WebCat2_Mac RETURNs in .db (1997)