5.0 feature request: Macro

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 40199
interpreted = N
texte = At 10:56 AM -0800 11/20/2001, Scott Anderson wrote: >Yes, but we are not ready to announce an ETA as this time. > >The 4.5 feature set is fixed, but we are still open to suggestions for the >5.0 feature set. I have been keeping track of feature suggestions made on >this list, so please keep them coming! I mentioned this a long while back, so it could be on your list, but here's my requested feature of the day...[macro name=XXX¶m1=YYY¶m2=ZZZ...]macro contents with access to passed-in parameters [YYY] and [ZZZ][/macro]This would essentially allow us to extend the WebDNA language through interpreted code snippets. Functionally it's the same as calling an INCLUDE file with parameters, but syntactically the calls look like regular WebDNA commands.For example, I've got an INCLUDE file that checks whether an entered email address is syntactically valid. Currently, I call it like this:[showif F=[include ^include/gCheckEmail&iAddress=[url][myAddressVar]]] ** The email is bad ** [/showif]With the macro definition, I could define the following:[macro name=ValidEmail¶m1=address][include ^include/gCheckEmail&iAddress=[url][address][/url]][/macro]Then, I could check an email with this syntax:[showif F=[ValidEmail address=[url][myAddressVar][/url]]] ** The email is bad ** [/showif] The benefits increase with the addition of more parameters.I use include files constantly for creating modular code. Having a way to define these as macro calls within the WebDNA language would make this much more fluid.It would also be nice to be able to define end-context code for situations where a context-format is more appropriate for the macro. For example, I often use a convertchars database to strip white space (tabs and returns) from contexts like replace, allowing me to enter the code in a more readable format. This looks like:[replace db=my.db&eqfielddatarq=[value]][ConvertChars db=^db/gTrim.db] field1=[value1] &field2=[value2] &field3=[value3] [/ConvertChars][/replace]If I could define the macros:[macro name=Trim][ConvertChars db=^db/gTrim.db][/macro] [macro name=/Trim][/ConvertChars][/macro]Then my code could look like this: [replace db=my.db&eqfielddatarq=[value]][Trim] field1=[value1] &field2=[value2] &field3=[value3] [/Trim][/replace] - 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://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. 5.0 feature request: Macro (Brian Fries 2001)
At 10:56 AM -0800 11/20/2001, Scott Anderson wrote: >Yes, but we are not ready to announce an ETA as this time. > >The 4.5 feature set is fixed, but we are still open to suggestions for the >5.0 feature set. I have been keeping track of feature suggestions made on >this list, so please keep them coming! I mentioned this a long while back, so it could be on your list, but here's my requested feature of the day...[macro name=XXX¶m1=YYY¶m2=ZZZ...]macro contents with access to passed-in parameters [YYY] and [ZZZ][/macro]This would essentially allow us to extend the WebDNA language through interpreted code snippets. Functionally it's the same as calling an INCLUDE file with parameters, but syntactically the calls look like regular WebDNA commands.For example, I've got an INCLUDE file that checks whether an entered email address is syntactically valid. Currently, I call it like this:[showif F=[include ^include/gCheckEmail&iAddress=[url][myAddressVar]]] ** The email is bad ** [/showif]With the macro definition, I could define the following:[macro name=ValidEmail¶m1=address][include ^include/gCheckEmail&iAddress=[url][address][/url]][/macro]Then, I could check an email with this syntax:[showif F=[ValidEmail address=[url][myAddressVar][/url]]] ** The email is bad ** [/showif] The benefits increase with the addition of more parameters.I use include files constantly for creating modular code. Having a way to define these as macro calls within the WebDNA language would make this much more fluid.It would also be nice to be able to define end-context code for situations where a context-format is more appropriate for the macro. For example, I often use a convertchars database to strip white space (tabs and returns) from contexts like replace, allowing me to enter the code in a more readable format. This looks like:[replace db=my.db&eqfielddatarq=[value]][ConvertChars db=^db/gTrim.db] field1=[value1] &field2=[value2] &field3=[value3] [/ConvertChars][/replace]If I could define the macros:[macro name=Trim][ConvertChars db=^db/gTrim.db][/macro] [macro name=/Trim][/ConvertChars][/macro]Then my code could look like this: [replace db=my.db&eqfielddatarq=[value]][Trim] field1=[value1] &field2=[value2] &field3=[value3] [/Trim][/replace] - 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://search.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:

RE: protect tag on NT (1997) Problems with [Applescript] (1997) Newbie Question about seeting price to 0 (1998) multipart (2004) Can Web Cat Do this? - LOOK (2000) I'm new be kind (1997) Field name-subcategory (1997) Need relative path explanation (1997) WebTen and WebCat (1997) Field names beginning with Reg.. (2002) Searching multiple Databases (1997) [SearchString] problem with [search] context (1997) 2.0 Info (1997) Summary search -- speed (1997) taxRate is fine but taxTotal isn't (1997) Possible to reset Linux file permissions w/in webcat [shell] ? (2000) Cancel Subscription (1996) Bug or syntax error on my part? (1997) Fun with Dates - finally resolved but.... (1997) Encyption mail (1998)