I have a situation where I am creating variables using scopes:
- normal named integers
When I run this code ...
<cflog text="in calendar function [#arguments.x#][#day_in#] [#day_out#]">
I get the values of 0 for all vars on my screen and the "correct" value (48000) in the cfadmin application.log file
I am beginning to suspect that CFBuilder is corrupting my source file?
Never seen this before.
It's not clear that we are seeing all the code you are referring to. You refer to what you see in logs vs on screen, but while we see a CFLOG we don't see a CFOUTPUT or even a CFSET. Given your subject and discussion, it seems it may be important to see that. So first, can you please repost your code, using the feature here to indicate what IS code? Click the 4th icon from the right in the buttons on the toolbar of the reply editor. That will open a box, letting you type the code. Then we will see clearly what you refer to.
Also, I gather you are using the brackets  to help set off visually your values, but beware that some folks reading your code quickly may think that you are meaning to create arrays. Again, I don't THINK that's at all a factor here, but I'm not sure we're really seeing ALL your code, so seeing it in the code view here will help.
cflog doesn't need a cfoutput.
but the entire thing is wrapped in a
You would be asleep - it's a 200+ line function.
BUT I "fixed" it. But the fix is NOT what I like as it makes no sense either.
I literally copied the entire function to another part of the .cfc. Renamed the copy to function_buggy,
renamed the calling line in js and it works.
I am suspecting a failing hard drive - corrupt sector? But a colleague of mine suggests if it were that the file would not (even) open.
I also copied the .cfc to a development server and it failed there.
To be clear, I didn't say that a cflog needs a cfoutput. 🙂 I said that you were referring to diffrences in what you saw on-screen vs in the logs, but the code you showed (or at least all we could see) did not show ANY code that would be causing output to the screen. That is what made me wonder if we were seeing all your code. And I see you've still have not edited your first post to use the code fragment feature here, nor added any in your reply.
But now you're saying you fixed it via the tweak you did, regarding just moving code/renaming methods. I agree that's not a satisfactory solution. 🙂 And I was about to leave it at that (thinking it may just be some odd compilation problem, fixed by those tweaks), but then you said you "copied the .cfc to a development server and it failed there". As that would have been re-compiled newly on the other server, if it's happening there then it would indeed seem to be something in the code still.
If could you break that code down to some small fragment the demonstrates your problem, which you could share here (using that code fragment feature), perhaps we may see something to help. And sometimes doing that even helps one to spot a problem on their own that was missed previously.
As always, just trying to help. (PS: I tweaked this a bit after posting it, so if you may have gotten the original sent by email, I hope you may see this and could reread what I wrote before replying, if it may influence how you would reply. I got a call just as I was about to send it and didn't have the chance to review it as I normally would before submitting it.)
Can you create a minimal, reproducible example that demonstrates the failure?