The first thing to remember with custom tags is to define your "attributes"
correctly.  It seems like your tag would require only ShipZip.

Calling your tag (where the name of the cf file is shipZipTag.cfm) would be
something like:
<cf_shipZipTag shipZip = "#shipZip#">

And your tag would look something like this:

<cfparam name="ATTRIBUTES.shipZip" default=0>

<CFIF #Left(ShipZip,1)# EQ #Left(StartRange,1)#>
        <CFIF #Mid(ShipZip,2,1)# GTE #Mid(StartRange,2,1)# AND #Mid(ShipZip,2,1)#
LTE #Mid(EndRange,2,1)#>
                <CFIF #Mid(ShipZip,3,1)# GTE #Right(StartRange,1)# AND 
#Mid(ShipZip,3,1)#
LTE #Right(EndRange,1)#>
                        <CFSET REQUEST.Zone = #ZoneRange#>
                </cfif>
        </cfif>
</cfif>

Note the change to the resulting variable to "REQUEST.Zone".  This allows
you to access variables created by a custom tag.  Anywhere on the calling
page *after* the custom tag, you can use the variable "#REQUEST.Zone#" and
get the resulting value.

Sharon


At 10:18 AM 5/8/2000 -0500, Larry Juncker wrote:
>I wrote a snippet of code that determines Canadian Postal Code (the first
>three letters any way).  What do I do to make this snippet a custom tag to
>use in other places.  I will place my code below.
>
>CFIF #Left(ShipZip,1)# EQ #Left(StartRange,1)#>
>       <CFIF #Mid(ShipZip,2,1)# GTE #Mid(StartRange,2,1)#
>               AND #Mid(ShipZip,2,1)# LTE #Mid(EndRange,2,1)#>
>                       <CFIF #Mid(ShipZip,3,1)# GTE #Right(StartRange,1)#
>                               AND #Mid(ShipZip,3,1)# LTE #Right(EndRange,1)#>
>                                       <CFSET Zone = #ZoneRange#>
>                       </cfif>
>       </cfif>
> </cfif>
>
>Thank You In Advance
>
>H   Larry Juncker
> L  Senior Cold Fusion Programmer
>  I Heartland Communications Group
>          Internet Division
>
>---------------------------------------------------------------------------
---
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
> 

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

Reply via email to