How about rewriting the current posted CF_FormUrl2Attributes to implement
the use of structures and posting it as a CF 4.5+ version.

Justin Kidman

-----Original Message-----
From: Steve Nelson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 21, 2000 4:49 AM
To: Fusebox
Subject: Re: [Fusebox] Updated FormUrl2attributes for CF 4.5


Do you mind if I post this to the fusebox taggallery?

Steve

Daniel Daugherty wrote:

> This message is in MIME format. Since your mail reader does not understand
> this format, some or all of this message may not be legible.
>
> ------_=_NextPart_000_01C02359.B604FCF0
> Content-Type: text/plain;
>         charset="iso-8859-1"
>
>   Attached is my version of FormUrl2Attributes.  It does not have all the
> features of the one on fusebox.org.  Namely no "search engine friendly
URL"
> code I don't use.  The changes I have made can be easily added to any
> version you use.  The major different is there are not evaluate functions
> anywhere in the tag.  Because form and url are structures now you can
access
> them with [] array notation.  You can also do a structcopy if attributes
is
> empty and move all the url or form vars over in one step (no looping).
>
>   In my tests it this version gives you 10% to 300% faster than the same
> code that uses evaluate and no structcopy.  Take a look.  I have done a
good
> bit of testing if you find any problems with it please let me know.
>
>   Daniel
>
>   <<formurl2attributes.cfm>>
>
> ------_=_NextPart_000_01C02359.B604FCF0
> Content-Type: application/octet-stream;
>         name="formurl2attributes.cfm"
> Content-Disposition: attachment;
>         filename="formurl2attributes.cfm"
>
> <cfsilent>
> <!--- This tag will turn all 'Form' and 'URL' scoped variables into
> 'Attributes' scoped variables.  This allows you to have a common scope
> of variables, thus allowing you to call the entire application i.e.
index.cfm
> as a CFMODULE or as a regular application.
> Designed for: CF 4.5+
> --->
> <cfif not isdefined('caller.attributes')>
>         <cfset caller.attributes=structnew()>
> </cfif>
> <cfif NOT StructIsEmpty(url)>
>         <cfif StructIsEmpty(caller.attributes)>
>                 <cfset caller.attributes=structcopy(url)>
>         <cfelse>
>                 <cfloop collection="#url#" item="urlname">
>                         <cfif not StructKeyExists(caller.attributes,
urlname)>
>                                 <cfset caller.attributes[urlname] =
url[urlname]>
>                         </cfif>
>                 </cfloop>
>         </cfif>
> </cfif>
>
> <cfif NOT StructIsEmpty(form)>
>         <cfif StructIsEmpty(caller.attributes)>
>                 <cfset caller.attributes=structcopy(form)>
>         <cfelse>
>                 <cfloop collection="#form#" item="field">
>                         <cfif not StructKeyExists(caller.attributes,
urlname)>
>                                 <cfset
caller.attributes[field]=form[field]>
>                         </cfif>
>                 </cfloop>
>         </cfif>
> </cfif>
> </cfsilent>
> ------_=_NextPart_000_01C02359.B604FCF0--
>
----------------------------------------------------------------------------
--
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

----------------------------------------------------------------------------
--
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------------------------------------------------------------------------------
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/fusebox or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to