Re: CFMX scope searching ?

2003-09-15 Thread Sean A Corfield
On Monday, Sep 15, 2003, at 13:12 US/Pacific, Ryan Stille wrote:
 I remember hearing somewhere that CFMX searched scopes differently, 
 like maybe it wouldn't search scopes at all anymore, you always had to 
 use Form.name instead of just using 'name' and letting it find it in 
 the Form scope (I know it's best pratice to scope anyway).

 Is there any truth to this or am I just making it up?  Anyone have a 
 URL that states this?  I searched but couldn't find anything.

You're hallucinating. CFMX should behave just like CF5 in respect to 
scope lookup (except, possibly, in some weird corner cases).

However, it is certainly better practice to always use scope qualifiers 
when referring to variables...

Sean A Corfield -- http://www.corfield.org/blog/

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com


RE: CFMX scope searching ?

2003-09-15 Thread Dave Watts
 I remember hearing somewhere that CFMX searched scopes 
 differently, like maybe it wouldn't search scopes at all 
 anymore, you always had to use Form.name instead of just 
 using 'name' and letting it find it in the Form scope (I know 
 it's best pratice to scope anyway).
 
 Is there any truth to this or am I just making it up? Anyone 
 have a URL that states this?  I searched but couldn't find 
 anything.

To the best of my knowledge, this isn't true. However, it'll take you about
five minutes to knock up an example which will tell you exactly what's going
on:

cfset Form.foo = form
cfset URL.foo = url

cfoutput#foo#/cfoutput

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: CFMX scope searching ?

2003-09-15 Thread Tyler Silcox
I just ran a test on CFMX 6.1 and I'm not sure if it's exactly the same or
not, here's the order I received:

1. variables 
2. url 
3. form 
4. cookie 
5. client 

...but: request, application, and query scoped values are not read.

Try:

cfset request.Bob=request!--- or switch out application for request
---
cfoutputBob = #Bob#/cfoutput

Or:

cfscript
Test=QueryNew(Bob);
QueryAddRow(Test, 1);
QuerySetCell(Test, Bob, query, 1);
/cfscript
cfoutputBob = #Bob#/cfoutput

Both examples throw an error. Is this how CF5 was? I always thought request
vars, at least, would creep a little into the local vars territory...

Tyler

Original Message- 
From: Dave Watts [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 4:45 PM
To: CF-Talk
Subject: RE: CFMX scope searching ?

 I remember hearing somewhere that CFMX searched scopes differently, 
 like maybe it wouldn't search scopes at all anymore, you always had to 
 use Form.name instead of just using 'name' and letting it find it in 
 the Form scope (I know it's best pratice to scope anyway).
 
 Is there any truth to this or am I just making it up? Anyone have a 
 URL that states this?  I searched but couldn't find anything.

To the best of my knowledge, this isn't true. However, it'll take you about
five minutes to knock up an example which will tell you exactly what's going
on:

cfset Form.foo = form
cfset URL.foo = url

cfoutput#foo#/cfoutput

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444


~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


Re: CFMX scope searching ?

2003-09-15 Thread Sean A Corfield
On Monday, Sep 15, 2003, at 15:28 US/Pacific, Tyler Silcox wrote:
 Both examples throw an error. Is this how CF5 was?

LiveDocs:

http://livedocs.macromedia.com/coldfusion/5.0/CFML_Reference/ 
Expressions3.htm

When a variable does not have a scope prefix, ColdFusion searches for  
it in the following sequence:

Local variables created using cfset and cfquery
CGI
File
URL
Form
Cookie
Client

You can compare this with CFMX 6.1:

http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/variab38.htm

If you use a variable name without a scope prefix, ColdFusion checks  
the scopes in the following order to find the variable:

Arguments
Variables (local scope)
CGI
Cffile
URL
Form
Cookie
Client

So the behavior is basically the same. No request scope.

Sean A Corfield -- http://www.corfield.org/blog/

If you're not annoying somebody, you're not really alive.
-- Margaret Atwood

~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com


RE: CFMX scope searching ?

2003-09-15 Thread Jim Davis
This is no real difference in the scope lookup order - however CFMX does
add some new scopes to the list (but it doesn't change the order of the
old ones).

Jim Davis

 -Original Message-
 From: Ryan Stille [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 15, 2003 4:13 PM
 To: CF-Talk
 Subject: CFMX scope searching ?
 
 I remember hearing somewhere that CFMX searched scopes differently,
like
 maybe it wouldn't search scopes at all anymore, you always had to use
 Form.name instead of just using 'name' and letting it find it in the
Form
 scope (I know it's best pratice to scope anyway).
 
 Is there any truth to this or am I just making it up?  Anyone have a
URL
 that states this?  I searched but couldn't find anything.
 
 I am on the digest list so please CC responses to me.
 
 Thanks,
 -Ryan
 
~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm