ah, I see. So the below...myobj.joe = 77; actually sets joe in the this scope?
seperate from the variables scope. Ok. kewl. This can keep errant code from moshing
with the 'privates'. Danke.
test.cfm
<cfscript>
myobj = CreateObject("Component", "test");
myobj.joe = 77;
WriteOutput(myobj.joe);
</cfscript>
test.cfc
<cfcomponent>
<cfset variables.joe = 55 />
</cfcomponent>
test.cfm runs fine and outputs 77.
BTW...on CFMX6.1
Doug
>-----Original Message-----
>From: Barney Boisvert [mailto:[EMAIL PROTECTED]
>Sent: Friday, September 19, 2003 5:53 PM
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] setting cfc vars etc not defined in a cfc?
>
>
>To continue the thought, if you put something in the 'variables' scope
>inside the CFC, you'll have a private member, much like a Java instance
>variable. Note that leaving the 'variables' scope off the
>variable should
>work, but there have been some quirks reported that it doesn't
>quite do it
>right, so either scope everything (recommended) or nothing.
>
>barneyb
>
>> -----Original Message-----
>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> Behalf Of Nathan Dintenfass
>> Sent: Friday, September 19, 2003 2:45 PM
>> To: [EMAIL PROTECTED]
>> Subject: RE: [CFCDev] setting cfc vars etc not defined in a cfc?
>>
>>
>> You cannot prevent it.
>>
>> A CFC is not a real "object" in the java sense you are
>talking about. It
>> behaves a lot more like a struct of functions (with some special
>> behaviors)
>> than a java object instance.
>>
>> Just FYI, if you had put "t" in the THIS scope inside your
>CFC you'd have
>> the same behavior since "THIS" is a reference to the public scope
>> of the CFC
>> instance.
>>
>>
>>
>> > -----Original Message-----
>> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>> > Behalf Of [EMAIL PROTECTED]
>> > Sent: Friday, September 19, 2003 2:34 PM
>> > To: [EMAIL PROTECTED]
>> > Subject: [CFCDev] setting cfc vars etc not defined in a cfc?
>> >
>> >
>> > Ok, playing around with stuff this afternoon. I created an
>> > 'empty' cfc named test.cfc, its empty for no good reason just a
>> > proof of concept
>> > <cfcomponent>
>> >
>> > <!--- empty --->
>> >
>> > </cfcomponent>
>> >
>> > Now I created test.cfm
>> > <cfscript>
>> >
>> > myobj = CreateObject("Component", "test");
>> > myobj.t=6;
>> > WriteOutput('t= ' & myobj.t);
>> > </cfscript>
>> >
>> > When I call test.cfm from ze browser I get no error. In fact I
>> > get t= 6 output to the browser. Now in Java, etc... this would
>> > bomb out. How can I programatically keep this from occuring? Or
>> > can I? Am I missing something here?
>> >
>> > Doug
>> >
>>
>> ----------------------------------------------------------
>> You are subscribed to cfcdev. To unsubscribe, send an email
>> to [EMAIL PROTECTED] with the word '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 word '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 word '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]