if you have "var = x;" in the function (or an argument called "x") then it
will return THAT "x", otherwise it will default to the "variables" scope.
Similar to a "normal" cfm file... and I recommend always prefixing ALL your
variables in CFCs and CFMs.

~Simon

Simon Horwith
CTO, Etrilogy Ltd. 
Member of Team Macromedia
Macromedia Certified Instructor 
Certified Advanced ColdFusion MX Developer
Certified Flash MX Developer
CFDJList - List Administrator
http://www.how2cf.com/


-----Original Message-----
From: Aidan Whitehall [mailto:[EMAIL PROTECTED]
Sent: 21 January 2004 11:25
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] CFC scoping


OK, getting stung a little by the scoping in CFCs yesterday, if you have
the following

cfc
 variables.x = 1;
 variables.y = 2;

 cffunction f
  cfreturn x
 /cffunction
/cfc

should you return 'variables.x' or is 'x' enough? Are there any
instances where returning 'x' can return something other than
'variables.x', for example if you have "var x = 0" at the start of
function f?

Thanks

-- 
Aidan Whitehall <mailto:[EMAIL PROTECTED]>
Macromedia ColdFusion Developer
Fairbanks Environmental Ltd  +44 (0)1695 51775
Queen's Awards Winner 2003 <http://www.fairbanks.co.uk/go/awards>

Fairbanks uses anti-spam filtering. If you sent an e-mail and expected
to receive a response but didn't, please call -- it may be that your
e-mail didn't make it to the intended mailbox.

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to