Michael, I appreciate your quick response to this matter and thanks for pointing out the good old toString() function. :)
Regards, Chris -----Original Message----- From: Michael Corbridge [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 13, 2002 4:43 AM To: CF-Talk Subject: RE: Possible cffile bug in CFMX I'm seeing this as well. I'll enter a bug. Here is another workaround ... -------------------------------------------- <cfset myVar = 2> <cfset myOtherVar = toString(myVar + 1)> <cffile action="write" file="#expandPath("cffileBug.txt")#" output="#myOtherVar#" addnewline="no"> michael d corbridge macromedia 617.219.2307 [EMAIL PROTECTED] -----Original Message----- From: Chris Kief [mailto:[EMAIL PROTECTED]] Sent: Sunday, October 13, 2002 2:00 AM To: CF-Talk Subject: RE: Possible cffile bug in CFMX Thanks for the response Lee. I'm glad I'm not the only one who is seeing this. I tried the following as a workaround and cffile worked as expected: <cfscript> // create myVar myVar = 1; // add 1 to myVar myOtherVar = myVar + 1; // java casting error workaround // this will force CF to cast myOtherVar back into a string myOtherVar = "x#myOtherVar#"; myOtherVar = replace(myOtherVar,"x","","all"); </cfscript> chris -----Original Message----- From: Lee Fuller [mailto:[EMAIL PROTECTED]] Sent: Saturday, October 12, 2002 10:39 PM To: CF-Talk Subject: RE: Possible cffile bug in CFMX That's interesting. Almost as if it's reverse type casting. Odd. Don't have the answer. But it's truly odd. | -----Original Message----- | From: Chris Kief [mailto:[EMAIL PROTECTED]] | Sent: Saturday, October 12, 2002 10:30 PM | To: CF-Talk | Subject: RE: Possible cffile bug in CFMX | | | I should note... | | Including ANY additional text in output="" along with the | variable will cause cffile to work as expected. (i.e. | output="X#myOtherVar#") | | chris | | | | -----Original Message----- | From: Chris Kief [mailto:[EMAIL PROTECTED]] | Sent: Saturday, October 12, 2002 10:26 PM | To: CF-Talk | Subject: Possible cffile bug in CFMX | | This may be a simple error on my part or a bug in CFMX: | | The following code simply creates a variable with the value | of 2 and writes it to a file...this works fine: | | <cfset myVar = 2 /> | | <cffile action="write" file="#filePath#" output="#myVar#" | addnewline="no" /> | | | | The follwing code creates the same variable, adds 1 to it, | and writes the the result to a file...this DOESN'T work: | | <cfset myVar = 2 /> | | <cfset myOtherVar = myVar + 1 /> | | <cffile action="write" file="#filePath#" | output="#myOtherVar#" addnewline="no" /> | | | | This code fails with the following error: | | Error casting an object of type java.lang.Double to an | incompatible type. This usually indicates a programming error | in Java, although it could also mean you have tried to use a | foreign object in a different way than it was designed. | java.lang.Double | | Any insights in to what this may be?? | | TIA, | chris | | | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm