Worked perfectly....I'm a dunderhead! Thanks.
D

At 10:58 AM 12/17/2003 -0800, you wrote:
Because your CFINVOKE call in this case is creating a new instance.

Change it to:

<cfinvoke component="#newVarTest#" method="more"></cfinvoke>

That should get you what you want.



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Darcey Spears
> Sent: Wednesday, December 17, 2003 10:50 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] "Variables" scope....tearing out hair
>
>
> Setting in the calling page didn't work:
>
> <cfset newVarTest =
> createobject("component","wherestom_working.dirPackage.standards_v
> ar_example")>
> <cfset aVar = newVarTest.example()>
>
> <cfinvoke
>   component="wherestom_working.dirPackage.standards_var_example"
>   method="more">
> </cfinvoke>
>
> same error...
> D
>
>
> At 10:19 AM 12/17/2003 -0800, you wrote:
> >You'd have to call your example() method first because that is
> where you set
> >up variables.nonPublicVar.  You could call example() inside of more(), or
> >call example() from the calling page in your example.
> >
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > > Behalf Of Darcey Spears
> > > Sent: Wednesday, December 17, 2003 10:10 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [CFCDev] "Variables" scope....tearing out hair
> > >
> > >
> > > Hi,
> > > Trying to figure out what I'm doing wrong here.....I'm using
> this example
> > > from Sean's CF Coding Standards:
> > >
> > > <cfcomponent>
> > >
> > >      <cffunction name="example">
> > >          <cfset var localVar = "Just in this function" />
> > >          <cfset variables.nonPublicVar = "Non-public data member" />
> > >          <cfset anotherNonPublicVar = "Not recommended - use
> > > 'variables'" />
> > >          <cfset this.publicVar = "Public data member" />
> > >      </cffunction>
> > >
> > >      <cffunction name="more">
> > >          <cfset var localVar = "Different to example localVar" />
> > >          <cfset var x = variables.nonPublicVar & " set in
> > > 'example' above" />
> > >      </cffunction>
> > >
> > > </cfcomponent>
> > >
> > > Display CFM page has:
> > >
> > > <cfobject name="someVarTest"
> > > component="wherestom_working.dirPackage.standards_var_example">
> > >
> > > <cfinvoke
> > >   component="#someVarTest#"
> > >   method="more">
> > > </cfinvoke>
> > >
> > > I've also tried just a direct invocation of the "more" method:
> > > <cfinvoke
> > >   component="wherestom_working.dirPackage.standards_var_example"
> > >   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.
> > >
> > > I'm running CFMX 6.1 on Windows XP with the default installation.
> > >
> > > I must be doing something wrong....but what??? My
> understanding is that
> > > "variables" scope variables are available to all methods in
> the component
> > > in which they are defined.
> > >
> > > Thanks for any help you can provide to keep my hair actually
> > > attached to my
> > > head... =:0
> > > Darcey
> > >
> > >
> > >
> > > 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]
>
> 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]

----------------------------------------------------------
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]

Reply via email to