Re: [WebDNA] function variables

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106821
interpreted = N
texte = 1) could not agree more about the comma separated parameters.. wait.. [table name=3Dproducts&fields=3DSKU,NAME,DESC] ummm... 2)=20 a) Way too much typing, i don't like typing that much. b) I can paint my cat brown and teach it to bark, or I can go buy a dog. = I'd rather buy a dog and do something else with my free time. c) not naming variables in function tags makes webdna nonstandard.=20 PYTHON:=20 def multiprint( n=3D5, txt=3D"" ): // also allows one to set default = values for variables if not overridden when called. RUBY: def some_method(a, b, c=3D25) // more of the same PHP: function writeName($fname,$punctuation) C++: output function_name (input_1, input_2, input_3, input_...) { =20 Brian B. Burton On Jun 23, 2011, at 8:05 PM, Brian Fries wrote: > The comma-separated parameters looks very alien in WebDNA code, where = & and =3D are king. This also would force an order dependency for the = parameters, which is also alien to WebDNA. That said, there's nothing = stopping you from implementing your function now: >=20 > [function name=3Dmadlibs][!] takes name,color,place,fruit,size [/!] > [!] default values [/!] > [text multi=3DT]tName=3DBilly = Bob&tColor=3Dpink&tPlace=3DHawaii&tFruit=3Dpineapple&tSize=3Dbig[/text] >=20 > [listwords words=3D[url][params_string][/url]&delimiters=3D,] > [switch value=3D[index]] > [case value=3D1][text]tName=3D[word][/text][/case] > [case value=3D2][text]tColor=3D[word][/text][/case] > [case value=3D3][text]tPlace=3D[word][/text][/case] > [case value=3D4][text]tFruit=3D[word][/text][/case] > [case value=3D5][text]tSize=3D[word][/text][/case] > [/switch] > [/listwords] >=20 > [return][tName] likes [tColor] cars at [tPlace], where [tFruit] = is [tSize].[/return] > [/function] >=20 > [madlibs Jane,orange,the mall,strawberry,monstrous] > =20 >=20 > Result: > Jane likes orange cars at the mall, where strawberry is monstrous. >=20 >=20 > Brian Fries > BrainScan Software >=20 >=20 >=20 > On Jun 23, 2011, at 3:21 PM, Brian B. Burton wrote: >=20 >> add to the wish list: >>=20 >> being able to set the names of incoming variables when defining the = function. Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] function variables (William DeVaul 2011)
  2. Re: [WebDNA] function variables ("Brian B. Burton" 2011)
  3. Re: [WebDNA] function variables (Brian Fries 2011)
  4. [WebDNA] function variables ("Brian B. Burton" 2011)
1) could not agree more about the comma separated parameters.. wait.. [table name=3Dproducts&fields=3DSKU,NAME,DESC] ummm... 2)=20 a) Way too much typing, i don't like typing that much. b) I can paint my cat brown and teach it to bark, or I can go buy a dog. = I'd rather buy a dog and do something else with my free time. c) not naming variables in function tags makes webdna nonstandard.=20 PYTHON:=20 def multiprint( n=3D5, txt=3D"" ): // also allows one to set default = values for variables if not overridden when called. RUBY: def some_method(a, b, c=3D25) // more of the same PHP: function writeName($fname,$punctuation) C++: output function_name (input_1, input_2, input_3, input_...) { =20 Brian B. Burton On Jun 23, 2011, at 8:05 PM, Brian Fries wrote: > The comma-separated parameters looks very alien in WebDNA code, where = & and =3D are king. This also would force an order dependency for the = parameters, which is also alien to WebDNA. That said, there's nothing = stopping you from implementing your function now: >=20 > [function name=3Dmadlibs][!] takes name,color,place,fruit,size [/!] > [!] default values [/!] > [text multi=3DT]tName=3DBilly = Bob&tColor=3Dpink&tPlace=3DHawaii&tFruit=3Dpineapple&tSize=3Dbig[/text] >=20 > [listwords words=3D[url][params_string][/url]&delimiters=3D,] > [switch value=3D[index]] > [case value=3D1][text]tName=3D[word][/text][/case] > [case value=3D2][text]tColor=3D[word][/text][/case] > [case value=3D3][text]tPlace=3D[word][/text][/case] > [case value=3D4][text]tFruit=3D[word][/text][/case] > [case value=3D5][text]tSize=3D[word][/text][/case] > [/switch] > [/listwords] >=20 > [return][tName] likes [tColor] cars at [tPlace], where [tFruit] = is [tSize].[/return] > [/function] >=20 > [madlibs Jane,orange,the mall,strawberry,monstrous] > =20 >=20 > Result: > Jane likes orange cars at the mall, where strawberry is monstrous. >=20 >=20 > Brian Fries > BrainScan Software >=20 >=20 >=20 > On Jun 23, 2011, at 3:21 PM, Brian B. Burton wrote: >=20 >> add to the wish list: >>=20 >> being able to set the names of incoming variables when defining the = function. "Brian B. Burton"

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:

More questions about serial number dishing (1997) AD Error Msg (1997) [WebDNA] No more SQL in 7.1? (2012) Hierarchy of form/text/math variables (renamed thread) (2000) Displaying photo attached to first record (1997) Links and Carriage Returns, Oh my! (2000) Thanks and Big News!!! (1997) I have troubles to send message out (1998) Separate SSL Server (1997) Re[2]: 2nd WebCatalog2 Feature Request (1996) To Err or Not Custom Error (1999) Error & Problem (1997) WebCat2 several catalogs? (1997) [table] question (2007) Base64 encryption limitations? (1999) [writefile] ugliness continued (2001) Special delete ... (1997) I'm having trouble using [url][interpret][math] together in lookup (1997) [AppendFile] problem (WebCat2b13 Mac .acgi) (1997) WebCatalog for Postcards ? (1997)