<cffunction name="more">
<cfset var localVar = "Different to example localVar" />
<cfset example()>
<cfset x = variables.nonPublicVar & " set in 'example' above" />
</cffunction>I had to take the X variable out of the var scope (otherwise it has to be at the top, before the 'example' function is called) and then call the example() function and then use variables.nonPublicVar.
So.......variables in the "variables" scope are available *after instantiation* to other methods in the component....probably sounds self-evident but I wasn't getting it!
(I did test the pseudo-constructor area and figured out that if variables.nonPublicVar was set there it would work, but I'm trying to work with variables inside methods....)
Thanks for your help! Darcey
At 10:20 AM 12/17/2003 -0800, you wrote:
<cfobject name="someVarTest" component="wherestom_working.dirPackage.standards_var_example">...
<cfinvoke
component="#someVarTest#"
method="more">
</cfinvoke>and no matter what I do with variables.nonPublicVar it just doesn't seem to be defined or available outside the method where it's created. I get an error saying "nonPublicVar is not defined in Variables" every time I try to use it.
You define Variables.nonPublicVar in the function "example", so you need to call that function before you call "more". Or you can define Variables.nonPublicVar when the component instantiates by placing it in the pseudo-constructor area, which is my preference.
--
Ben Curtis WebSciences International http://www.websciences.org/ v: 310 478 6648 f: 310 235 2067
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
Darcey Spears Q3Studios Collaborative Web Development www.q3studios.com 520-360-5425
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
