Cameron, 

Here's the code used to expose the behavioral difference between CF7 and 
CF8.


        <cfset blah = duplicate(url)>

        <cfdump var="#structCount(URL)#">
        <cfdump var="#URL#" label="URL">
 
        <cfscript>
          // handle the url string
          if (isDefined("blah.var1")) StructDelete(blah,"var1");
          if (isDefined("blah.var2")) StructDelete(blah,"var2");
        </cfscript>
        <cfdump var="#StructKeyExists(blah,'var1')#"><br>
        <cfdump var="#structCount(blah)#"><cfdump var="#blah#" 
label="blah">
        <cfdump var="#structCount(url)#"><cfdump var="#url#" label="url">
 
        <cfscript>
          // handle the url string
          if (isDefined("url.var1")) StructDelete(url,"var1");
          if (isDefined("url.var2")) StructDelete(url,"var2");
        </cfscript>

        <cfabort>



with this query_string passed in: 
/index.cfm?Var2=1234123&var1=1234123&enum=260745&blah=5&

Here's what the dumps say:


4 URL - struct 

BLAH 5 
ENUM 260745 
VAR1 1234123 
VAR2 1234123 

NO 


2 blah - struct
 
BLAH 5 
ENUM 260745 
 

4 url - struct 

BLAH 5 
ENUM 260745 
VAR1 1234123 
VAR2 1234123 




David Scruggs 
Sr Web Development Programmer/Analyst
Systems Department
(404) 498-7988






"Cameron Childress" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
09/04/08 02:38 PM
Please respond to
[email protected]


To
[email protected]
cc

Subject
Re: [ACFUG Discuss] structCount and structDelete






I think structDelete() returns true/false for success/fail on deleting
keys.  What do you see if you
<cfoutput>#structDelete(url,'three')#</cfoutput>?

-Cameron

On Thu, Sep 4, 2008 at 2:21 PM,  <[EMAIL PROTECTED]> wrote:
>
> Does anyone know of a difference between CF7 and CF8 concerning 
structCount
> and structDelete? The following code snippet performs differently in CF7 
and
> CF8:
>
> <cfset url=structNew()/>
> <cfset url.one = 1/>
> <cfset url.two = 2/>
> <cfset url.three = 3/>
>
> <cfdump var="#structCount(url)#"/>
> <cfdump var="#url#"/>
>
> <cfset structDelete(url,'three')/>
>
> <cfdump var="#structCount(url)#"/>
> <cfdump var="#url#"/>
>
> When you run the above code snippet in CF7 the structCount(url) return 3
> then 2 (after the delete). But in CF8 it returns 3 and 3 again.
>
> Interestingly the problem seems to manifest itself when using the 'url'
> structure name (variable scope).
>
> Please let me know if this is a known 'behavior' and if so - does Adobe 
have
> any documentation on it.
>
> Sincerely,
>
> Brooks Wilson
>
> Assert your right to make a few mistakes. If people can't accept your
> imperfections, that's their fault. - Dr David M Burns
>
>  Federal Reserve Bank of Atlanta · 1000 Peachtree Street, N.E. · Atlanta
> Georgia 30309-4470
> 404.498.8178 · fax 404.498.8239 · [EMAIL PROTECTED]
>
>



-- 
Cameron Childress
Sumo Consulting Inc
http://www.sumoc.com
---
cell: 678.637.5072
aim: cameroncf
email: [EMAIL PROTECTED]


-------------------------------------------------------------
To unsubscribe from this list, manage your profile @ 
http://www.acfug.org?fa=login.edituserform

For more info, see http://www.acfug.org/mailinglists
Archive @ http://www.mail-archive.com/discussion%40acfug.org/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------







-------------------------------------------------------------

To unsubscribe from this list, manage your profile @ 

http://www.acfug.org?fa=login.edituserform



For more info, see http://www.acfug.org/mailinglists

Archive @ http://www.mail-archive.com/discussion%40acfug.org/

List hosted by http://www.fusionlink.com

-------------------------------------------------------------


Reply via email to