Re: Listing parameters passed into a [function]

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 49667
interpreted = N
texte = You can use the new [params_string] tag from within the function code to see the 'raw' parameter string. For example:[function name=test] Function 'test' called with parameters: [Params_string] [/function][test var1=123&var2=abc]would produce... Function 'test' called with parameters: var1=123&var2=abc You could wrap that with a ListWords to break up the parameter list.> -----Original Message----- > From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of > Brian Fries > Sent: Monday, April 21, 2003 4:46 PM > To: WebDNA Talk > Subject: Listing parameters passed into a [function] > > > I'm playing with WebDNA 5's [function] context, and I'm trying to > figure out how to extract a list of the parameters that are passed in > to the function - like using [formvariables form=include] for > [include] > files... > > Has anyone figured out how to do this? Does SMSI have any suggestions? > > I've tried using all combinations of listvariables' and > formvariables' > parameters with no success. > > What I want to do is to have some optional parameters into a > function... such as: > > [function name=FolderCount] > [if ...parameter hierarchical is passed in and has a value > of T...] > [then]...count items in the passed-in folder path plus all sub > folder...[/then] > [else]...only count items in the passed-in folder itself, not any sub > folders...[/else] > [if] > [return][thecount][/return] > [/function] > > Then call it these ways: > > [text]count=[FolderCount path=/this/folder][/text] > [text]count=[FolderCount path=/this/folder&hierarchical=T][/text] > [text]count=[FolderCount path=/this/folder&hierarchical=F][/text] > > > The best I've determined is I can test for: > > [if ([:local:hierarchical]=%5Bhierarchical%5D)] > [then]...param hierarchical was not passed in...[/then] > [/if] > > This works, and will suit my current purpose, but for future use I'd > sure like to be able to do generate a list of passed-in parameters > without necessarily knowing their names ahead of time, as I > frequently > do with formvariables and listvariables. > > - Brian > > > ------------------------------------------------------------- > 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: Listing parameters passed into a [function] (Scott Anderson 2003)
  2. Listing parameters passed into a [function] (Brian Fries 2003)
You can use the new [params_string] tag from within the function code to see the 'raw' parameter string. For example:[function name=test] Function 'test' called with parameters: [Params_string] [/function][test var1=123&var2=abc]would produce... Function 'test' called with parameters: var1=123&var2=abc You could wrap that with a ListWords to break up the parameter list.> -----Original Message----- > From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of > Brian Fries > Sent: Monday, April 21, 2003 4:46 PM > To: WebDNA Talk > Subject: Listing parameters passed into a [function] > > > I'm playing with WebDNA 5's [function] context, and I'm trying to > figure out how to extract a list of the parameters that are passed in > to the function - like using [formvariables form=include] for > [include] > files... > > Has anyone figured out how to do this? Does SMSI have any suggestions? > > I've tried using all combinations of listvariables' and > formvariables' > parameters with no success. > > What I want to do is to have some optional parameters into a > function... such as: > > [function name=FolderCount] > [if ...parameter hierarchical is passed in and has a value > of T...] > [then]...count items in the passed-in folder path plus all sub > folder...[/then] > [else]...only count items in the passed-in folder itself, not any sub > folders...[/else] > [if] > [return][thecount][/return] > [/function] > > Then call it these ways: > > [text]count=[FolderCount path=/this/folder][/text] > [text]count=[FolderCount path=/this/folder&hierarchical=T][/text] > [text]count=[FolderCount path=/this/folder&hierarchical=F][/text] > > > The best I've determined is I can test for: > > [if ([:local:hierarchical]=%5Bhierarchical%5D)] > [then]...param hierarchical was not passed in...[/then] > [/if] > > This works, and will suit my current purpose, but for future use I'd > sure like to be able to do generate a list of passed-in parameters > without necessarily knowing their names ahead of time, as I > frequently > do with formvariables and listvariables. > > - Brian > > > ------------------------------------------------------------- > 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/ Scott Anderson

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:

Unzip + ddos attack?? (2005) OT Big Brother (please ignore this sociological trivia) (2000) Smith Micro - no competition (2000) New Command prefs ... (1997) REPOST: Upgrage pricing... The future of WebCatalog iscoming with 4.0... (2000) failed installs on OS X Server 10.2.6/XServe/WebStar (2003) Re:Frames and cart values (1998) WebCatalog-NT?'s (1996) bannerads example idiot (1997) Plain Language Manual? (1998) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Different Drive (2003) Serving images from databases (1998) Which GUI HTML editors work with WC ? (1997) Don't know if this is a sily question... (2003) Upgrade on MacOSX 3.05 to 3.08 (2000) web delivery (1997) Country & Ship-to address & other fields ? (1997) PSC recommends what date format yr 2000??? (1997) Undeliverable Mail (1997)