this is what i get....cf5

A hello world  
APPLICATIONNAME POINTERTEST  
B C hello world  
D E hello world  
 
application.a = hello world
application.b.c = hello world
application.b.d.e = hello world

in a structure view though ;)

tw

-----Original Message-----
From: S. Isaac Dealey [mailto:info@;turnkey.to] 
Sent: Saturday, October 19, 2002 11:03 AM
To: CF-Talk
Subject: RE: session vars and locking


Could someone run this on a CF 5 server with full-checking selected in
the
memory variables area in the cfadmin and confirm that my CF server isn't
working properly?

This test was written with the intention of confirming that simple
values
either do or do not get passed by reference in a <cfset> tag, however,
my cf
server seems to not be working, so I can't perform the test, because
it's
not producing the expected error from variable accesses which are
definitely
improperly locked.

<cfapplication name="pointertest"
applicationtimeout="#createtimespan(0,5,0,0)#">

<cflock scope="application" type="exclusive" timeout="10">
        <cfscript>
                application.a = "hello world";
                application.b = structnew();
                application.b.c = "hello world";
                application.b.d = structnew();
                application.b.d.e = "hello world";
        </cfscript>
        <cfdump var="#application#">
</cflock>

<cflock scope="application" type="readonly" timeout="10">
        <cfset request.a = application.a>
        <cfset request.b = application.b>
</cflock>

<cfoutput>
        <div>application.a = #request.a#</div>
        <div>application.b.c = #request.b.c#</div>
        <div>application.b.d.e = #request.b.d.e#</div>
</cfoutput>

After running this, outputting #request.b.d.e# at the bottom should
produce
an error since request.b is supposed to be a pointer reference to
application.b and therefore request.b.d.e should be in the application
scope
and not properly locked. For that matter, request.b.c should be in the
application scope as well, so both of these should produce an error, but
neither are on my machine, even though full-checking is turned on in the
CF
admin.

In any event, if it errors on request.b.c or request.b.d.e but not on
request.a then this confirms that simple values are not passed as
pointer
references but as literal strings. That being said, I still think
duplicate
should always be applied when using persistent scopes in development /
production.

Isaac
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to