Just to clarify something here. I'd only just got out of bed (pre coffee!) when I replied before, and what I described isn't *quite* what happens.
CFC functions reside in the THIS scope; unscoped variables get put in the
VARIABLES scope. So it doesn't actually overwrite the function, and indeed I
guess you'd have no problems if you were only ever calling the function from
outside the object (ie: from the calling code). The problem arises when you
try to use the function from within another function in the same CFC: it'll
resolve the variable-name (ie: the function name you're trying to call) from
the VARIABLES scope first, rather than the function in the THIS scope. Hence
it "not working".
I guess one solution would be to always this-scope you function calls but...
*bleah*. And I believe there might be some special behaviour if you this-scope
a function call, and then that function internally calls a PRIVATE method? Not
sure. Something weird happens anyhow.
The main point is... VAR ALL YOUR VARIABLES! (Or scope them if you actually
INTEND them to be variables-scoped). Makes for less hassle and makes your code
cleared.
Cheers.
Adam
-----Original Message-----
From: Adam Cameron on behalf of Adam Cameron
Sent: Sat 13/11/2004 7:52 AM
To: [EMAIL PROTECTED]
Cc:
Subject: RE: [CFCDev] CFC Error - "Name Can't be empty"
<cffunction name="GetAuditWorkflow" access="public" returntype="query"
<cfquery name="GetAuditWorkflow" datasource="#ARGUMENTS.datasource#">
It's not the cause of the problem you're seeing, but it'll be the cause of the
next problem you see...
You're not VARing the GetAuditWorkflow query, so it'll be put in the CFC's
VARIABLES scope, which is where the same-named function itself currently
resides. So the next time you try to use that function in that instance of the
CFC... it won't be there.
Adam
<<winmail.dat>>
