Request scope variables are the same as Variables scope variables EXCEPT that are
global across all Custom Tags and CFMODULE calls. They are created when you first set
them, and they disappear at the end of the page request.
If you set Request.myvar = 5 in the calling file, then call a CF_MODULE or a Custom
Tag (same thing) Request.myvar will still be 5 in the module. If you change it in the
module, when the module finishes the calling file will have the changed value.
This is useful for when you want to use a value anywhere, no matter how nested your
modules are. For example, you may want to set:
<!--- Application.cfm --->
<cfset Request.DSN = "MY-DATABASE">
So you can use #Request.DSN# anywhere in your files, even in your modules. Of course
Application variables would also be available anywhere but you have to lock those...
At 10:05 AM 9/7/00 +0100, Aidan Whitehall wrote:
>The ColdFusion Locking Best Practices article
>http://www.allaire.com/handlers/index.cfm?ID=17318&Method=Full&Title=ColdFus
>ion%20Locking%20Best%20Practices&Cache=False
>talks about using the request scope when you want to use application
>variables for DSN names
>
>Can anyone explain what request scope variables are and when to use them? A
>little sample code would be really helpful :-)
>
>CF Studio help has a paragraph on the page "Passing Attribute Values between
>Custom Tags", but it didn't help much and a search on allaire.com didn't
>produce anything valuable.
>
>
>Thanks in advance
>
>--
>Aidan Whitehall <[EMAIL PROTECTED]>
>Netshopper UK Ltd
>Advanced Web Solutions & Services
>
>http://www.netshopperuk.com/
>Telephone +44 (01744) 648650
>Fax +44 (01744) 648651
>------------------------------------------------------------------------------
>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.