This content has been marked as final.
Show 9 replies
-
1. Re: Global CFC Variables
insuractive Dec 21, 2006 11:58 AM (in response to Dan Bracuk)Could you be getting a scope collision with the arguments variables and your global variables? What happens if you rename the arguments or the global vars? I've gotten the CFC global variables thing to work before, but I usually make sure that the global variables name differ from my local or input variables. -
2. Re: Global CFC Variables
Dan Bracuk Dec 21, 2006 12:14 PM (in response to Dan Bracuk)Renaming the global variables made it work. Thank you very much. I take back half the bad things I said about you.
-
3. Re: Global CFC Variables
Newsgroup_User Dec 21, 2006 12:27 PM (in response to Dan Bracuk)Renaming the global variables made it work. Thank you very much. I
take back half the bad things I said about you.
OR properly scope all your variables. Use variables.myStuff when you
want the global variables and this.myStuff when you want public
variables, arguments.myStuff for arguments extra. -
4. Re: Global CFC Variables
Adam Cameron Dec 22, 2006 2:15 AM (in response to Dan Bracuk)Dan which version of CF are you running? I ran your code in 7,0,2,142559 and did not see what you saw. When dumping the variables scope in blocks(), I saw the "new" values (as set by init()), not the initial ones.
I cannot state how much I agree with Ian: always scope your variables.
--
Adam -
5. Re: Global CFC Variables
Adam Cameron Dec 22, 2006 2:18 AM (in response to Dan Bracuk)Ditto 6,1,0,63958.
--
Adam -
6. Global CFC Variables
Dan Bracuk Dec 22, 2006 7:23 AM (in response to Adam Cameron)quote:
Originally posted by: Adam Cameron
Dan which version of CF are you running? I ran your code in 7,0,2,142559 and did not see what you saw. When dumping the variables scope in blocks(), I saw the "new" values (as set by init()), not the initial ones.
I cannot state how much I agree with Ian: always scope your variables.
--
Adam
7.0.2 -
7. Re: Global CFC Variables
Adam Cameron Dec 22, 2006 7:31 AM (in response to Dan Bracuk)Err... there is no such version of CF as 7.1.2: 7,0,2,142559 is the latest.
Go into CF Administrator, and look at the System Info page.
I know that CFMX60 has major problems with CFCs (in particular with variables scopes), and should be avoided. I am unaware of any such problems in latter versions of CF.
--
Adam -
8. Re: Global CFC Variables
Dan Bracuk Dec 22, 2006 8:09 AM (in response to Adam Cameron)quote:
Originally posted by: Adam Cameron
Err... there is no such version of CF as 7.1.2: 7,0,2,142559 is the latest.
Go into CF Administrator, and look at the System Info page.
I know that CFMX60 has major problems with CFCs (in particular with variables scopes), and should be avoided. I am unaware of any such problems in latter versions of CF.
--
Adam
7,0,2,142559
For the record, I am strictly a developer and don't have access to our admin page. It's a nice situation, I highly recommend it. -
9. Re: Global CFC Variables
Stressed_Simon Dec 28, 2006 1:16 AM (in response to Dan Bracuk)If you do not have access to the administrator you can see the cf version by dumping the server scope.



