Put this in some code and comment in and out the line in the function where
a is set.

You'll see an error occur.

-------------snip-------------
<cfscript>
function a() {
        a = "this is a text string";
        return randrange(100,1000);
}
</cfscript>

<cfoutput>
#a()#
<br>
#a()#
</cfoutput>
-------------snip-------------

Paul
-------------------------------------------
Paul Johnston
PJ Net Solutions Ltd
http://www.pjnetsolutions.com
[EMAIL PROTECTED]
+44 (0)7866 573013


> -----Original Message-----
> From: Paul Johnston [mailto:[EMAIL PROTECTED]] 
> Sent: 03 February 2003 15:59
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] UDF problem
> 
> 
> Are you overwriting the variable caller.fixeddate within the 
> function?  That would certainly cause the function to break.
> 
> The function does have access to the variables in the calling page.
> 
> Paul
> -------------------------------------------
> Paul Johnston
> PJ Net Solutions Ltd
> http://www.pjnetsolutions.com
> [EMAIL PROTECTED]
> +44 (0)7866 573013
> 
> 
> > -----Original Message-----
> > From: David Phipps [mailto:[EMAIL PROTECTED]]
> > Sent: 03 February 2003 15:50
> > To: [EMAIL PROTECTED]
> > Subject: RE: [ cf-dev ] UDF problem
> > 
> > 
> > Definitely not overwriting it as the two queries are called
> > directly after 
> > one another.  The whole section of code is below:
> > 
> > <cfif attributes.noPressRelease EQ 0>
> >           <!--- Update the releaseManager table with the
> > release to press 
> > dates and times --->
> >           <cfquery name="updateReleaseManagerPress" 
> > datasource="#request.dsn#" dbtype="ODBC">
> >                  UPDATE releaseManager
> >                  SET releaseDate = <cfif 
> > attributes.immediateRelease EQ 1 
> > AND attributes.isReleased NEQ 1><cfqueryparam 
> cfsqltype="CF_SQL_DATE" 
> > value="#Now()#"><cfelse><cfqueryparam cfsqltype="CF_SQL_DATE" 
> > value="#fixedDate(attributes.releaseDate)#"></cfif>,
> >                                  releaseTime = <cfqueryparam 
> > cfsqltype="CF_SQL_TIME" value="#attributes.releaseTime#">,
> >                                  immediateRelease = 
> > #attributes.immediateRelease#,
> >                                  releasedBy = 
> > '#session.currentuser.realname#',
> >                                  processedDate = <cfqueryparam 
> > cfsqltype="CF_SQL_DATE" value="#Now()#">,
> >                                  isReleased = 1
> >                  WHERE releaseid = '#attributes.releaseid#'
> >           </cfquery>
> >   </cfif>
> > 
> >   <cfif attributes.webRelease EQ 1>
> >   <!--- Update the releaseManager table with web release info --->
> >   <cfquery name="updateReleaseManagerWeb" datasource="#request.dsn#"
> > dbtype="ODBC">
> >          UPDATE releaseManager
> >          SET webRelease = #attributes.webRelease#,
> >                          webDate = <cfif attributes.webDate IS NOT 
> > ""><cfqueryparam cfsqltype="CF_SQL_DATE" 
> > value="#fixedDate(attributes.webDate)#"><cfelse><cfqueryparam 
> > cfsqltype="CF_SQL_DATE" value="#Now()#"></cfif>
> >          WHERE releaseid = '#attributes.releaseid#'
> >   </cfquery>
> >   </cfif>
> > 
> > So unless the cfqueryparam tag is clearing the fixedDate()
> > function then I 
> > can't see why it works in the first query and not in the second.
> > 
> > As you can see there is nothing happening between the first
> > call and second 
> > call to the function that would reset it or is there?  Am I 
> > missing something?
> > 
> > Thanks
> > 
> > Dave
> > 
> > At 15:38 03/02/2003 +0000, you wrote:
> > > > is it possible you're overriding the function name somewhere?
> > >
> > >Suggestion on this front is to put all your functions in a 
> structure
> > >somewhere that won't get overwritten, something like 
> "function" and 
> > >then call it via:
> > >
> > >Function.webdate(date)
> > >
> > >You can put functions into the request scope too, and that
> > makes them
> > >available over all custom tags.
> > >
> > >As is said above, check you aren't overwriting "fixeddate" 
> parameter
> > >anywhere.
> > >
> > >Paul
> > >
> > > > > -----Original Message-----
> > > > > From: David Phipps [mailto:[EMAIL PROTECTED]]
> > > > > Sent: 03 February 2003 15:30
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: [ cf-dev ] UDF problem
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > I have a page that is running two update queries and
> > both make use
> > > > > of a UDF which is cfincluded in the Application.cfm
> > > > >
> > > > > The first query uses the function and updates the db with no
> > > > > problem but the second call to the function thrwows the 
> > following
> > > > > error:
> > > > >
> > > > > Error Diagnostic Information
> > > > >
> > > > > An error occurred while evaluating the expression:
> > > > >
> > > > >
> > > > > "#fixedDate(attributes.webDate)#"
> > > > >
> > > > > Error near line 56, column 95.
> > > > >
> > > > > The symbol you have provided (fixedDate) is not the name of a
> > > > > function...
> > > > >
> > > > > Why am I able to call the function the first time and
> > then not a
> > > > > second time?
> > > > >
> > > > > Is this a bug with UDF's?
> > > > >
> > > > > The two queries look like:
> > > > >
> > > > > This one works:
> > > > >
> > > > > <cfquery name="updateReleaseManagerPress"
> > > > > datasource="#request.dsn#" dbtype="ODBC">
> > > > >                  UPDATE releaseManager
> > > > >                  SET releaseDate = <cfif 
> > > > > attributes.immediateRelease EQ 1 AND 
> attributes.isReleased NEQ 
> > > > > 1><cfqueryparam
> > > > cfsqltype="CF_SQL_DATE"
> > > > > value="#Now()#"><cfelse><cfqueryparam cfsqltype="CF_SQL_DATE"
> > > > > value="#fixedDate(attributes.releaseDate)#"></cfif>,
> > > > >                                  releaseTime = <cfqueryparam 
> > > > > cfsqltype="CF_SQL_TIME" value="#attributes.releaseTime#">,
> > > > >                                  immediateRelease = 
> > > > > #attributes.immediateRelease#,
> > > > >                                  releasedBy = 
> > > > > '#session.currentuser.realname#',
> > > > >                                  processedDate = 
> <cfqueryparam 
> > > > > cfsqltype="CF_SQL_DATE" value="#Now()#">,
> > > > >                                  isReleased = 1
> > > > >                  WHERE releaseid = '#attributes.releaseid#' 
> > > > > </cfquery>
> > > > >
> > > > > This throws the error:
> > > > >
> > > > > <cfquery name="updateReleaseManagerWeb"
> > datasource="#request.dsn#"
> > > > > dbtype="ODBC">
> > > > >          UPDATE releaseManager
> > > > >          SET webRelease = #attributes.webRelease#,
> > > > >                          webDate = <cfif
> > attributes.webDate IS NOT
> > > > > ""><cfqueryparam cfsqltype="CF_SQL_DATE"
> > > > > value="#fixedDate(attributes.webDate)#"><cfelse><cfqueryparam
> > > > > cfsqltype="CF_SQL_DATE" value="#Now()#"></cfif>
> > > > >          WHERE releaseid = '#attributes.releaseid#'
> > > > >   </cfquery>
> > > > >
> > > > > attributes.releaseDate = 03/02/03
> > > > > attributes.webDate = 3/2/2003
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Thanks
> > > > >
> > > > > Dave
> > > > >
> > > > >
> > > > > --
> > > > > ** 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]
> > > >
> > >
> > >
> > >
> > >
> > >--
> > >** 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]
> > 
> 
> 
> 
> 
> -- 
> ** 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