Highlighted

Variables different based on display mechanism

Community Beginner ,
Dec 19, 2019

Copy link to clipboard

Copied

I have a situation where I am creating variables using scopes:

- arguments

- normal named integers

When I run this code ... 

day in=[#day_in#]
<cflog text="in calendar function [#arguments.x#][#day_in#] [#day_out#]">
din[#day_in#]

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. 

 

TOPICS
Advanced techniques, Builder

Views

874

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Variables different based on display mechanism

Community Beginner ,
Dec 19, 2019

Copy link to clipboard

Copied

I have a situation where I am creating variables using scopes:

- arguments

- normal named integers

When I run this code ... 

day in=[#day_in#]
<cflog text="in calendar function [#arguments.x#][#day_in#] [#day_out#]">
din[#day_in#]

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. 

 

TOPICS
Advanced techniques, Builder

Views

875

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 19, 2019 0
Adobe Community Professional ,
Dec 19, 2019

Copy link to clipboard

Copied

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.

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 19, 2019 0
Community Beginner ,
Dec 19, 2019

Copy link to clipboard

Copied

cflog doesn't need a cfoutput. 

but the entire thing is wrapped in a 

<cfoutput><cfsavecontent variable="this">

 

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. 

 

 

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 19, 2019 0
Adobe Community Professional ,
Dec 19, 2019

Copy link to clipboard

Copied

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.)

/Charlie (server troubleshooter, carehart.org)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 19, 2019 0
Advocate ,
Dec 19, 2019

Copy link to clipboard

Copied

Can you create a minimal, reproducible example that demonstrates the failure?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 19, 2019 0
BKBK LATEST
Adobe Community Professional ,
Dec 22, 2019

Copy link to clipboard

Copied

Hi coder1957__,

It would really help if you shared the entire code with the forum.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 22, 2019 0