They are being very specific so that there is never any ambiguity over which variable 
they are talking about if there are more than one with the same name in different 
scopes (ie variables.production and URL.production). Variables comes first in the 
search order so it isn't THAT necessary... EXCEPT for query variables - they come 
before "variables". It is said to be faster when you are explicit but since 
"variables" is the second scope searched it's probably not much faster.


At 01:27 PM 8/24/00 +0000, Terri Stocke wrote:
>Okay, another "best practice" question, I guess...
>
>I have inherited an application from someone. In going through the code, I 
>notice that this person refers to several variables by using 
>"Variables.(whatever)". I'm assuming "Variables" is a reserverd term? I 
>can't find any documentation on this in my reference books.
>
>Why would one choose to reference variables by preceding it this way?
>For example:
>
><CFDIRECTORY ACTION="List" DIRECTORY="mypath" NAME="CurrentDir">
><cfoutput>
>   <CFIF #CurrentDir.Name# IS ""> <CFSET PRODUCTION="TRUE">
>   <CFELSE>                       <CFSET PRODUCTION="FALSE">
>   </CFIF>
></cfoutput>
>
><CFIF #Variables.PRODUCTION# IS "TRUE"> ... etc.
>
>I would write the IF statement as:
>
><CFIF PRODUCTION IS "TRUE">... etc.
>
>Why did this other person refer to "Variables.PRODUCTION"?  They've done 
>this throughout the code...
>
>Thanks!
>Terri
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>------------------------------------------------------------------------------
>Archives: http://www.mail-archive.com/[email protected]/
>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. 


---------------------------------------------------------------------------
Peter Theobald, Chief Technology Officer
LiquidStreaming http://www.liquidstreaming.com
[EMAIL PROTECTED]
Phone 1.212.545.1232 Fax 1.212.679.8032

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
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