Listing parameters passed into a [function]

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 49665
interpreted = N
texte = 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/ 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)
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/ Brian Fries

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:

db access problem after switching to SSL (2001) PCS Frames (1997) WC2b15 File Corruption (1997) Include vs. lookup-opps (1998) Format Thousands Looks Busted (2000) Sensations (1997) Serving images from databases (1998) Converting order file to database (1998) Post arguments problem mac? (1997) Cobalt RaQ2 and WebCatalog: who uses it? (2000) Search/sort in URL Was: GuestBook example (1997) RE: Formulas.db + Users.db (1997) PCS Frames (1997) database size? (1997) Upgrading old WebCat Database Files (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) math variable security [MEDIUM LONG] (2000) Multi or auto submit (1999) Re2: frames & carts (1997) Changing names of .hdr field names (2003)