Variable seeming to be changed when it shouldn't

I've come across an issue with using one of my old custom reporters in V10

ddateTime

If I run this in a local copy of 9.2.18 it works as expected

But not in V10

If you run it, the debugging says 2024 then thinks 0

I can't see why that should be!

Did some git bisecting and this is the result

efdb0a8d8a71b87be2bd1687d5fcfb6083cdcb3b is the first bad commit
commit efdb0a8d8a71b87be2bd1687d5fcfb6083cdcb3b
Author: Jens Mönig <jens@moenig.org>
Date:   Wed Aug 2 21:48:38 2023 +0200

    moved script var declaration to multi-arg evaluation
    
    eliminates necessity for doDeclareVariables()

 DEVLOG.md      |  2 ++
 src/threads.js | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
simon@simon-HP-Desktop-M01-F1xxx:/media/simon/DATA/Snap$ 

As usual PEBKAC :slight_smile:

It was a case of how come it managed to work OK in V9 :slight_smile:

This was wrong - I was re-using yyyy in the call (I've no idea why I did so)

All ok now
image

ddateTime

Hmm, you're right that your code was needlessly complicated for your purpose, but still, I don't understand why it shouldn't work. YYYY inside the ring refers to a different variable from YYYY outside the ring, but they have the same value, and in any case, nothing in that code sets either variable to zero. It sounds to me as if the formal parameter of the ring is being created in the outer scope (with initial value zero) instead of just in the inner scope.

So I think you've indeed found a v10 bug and I'm un-checking the Solution box. No doubt Jens will explain why I'm wrong, especially since I've just rolled out of bed. :~)

This does look like a bug. I'm investigating...

looks like this happened when I tried to support your streams work. Sigh.

Oh. Bleagh.

Please try to fix it in a way that doesn't break streams! :~/

Found it! Turns out the bug is unrelated to the streams work / TCO adjustments after all. I'm saving the fix for the next patch. But at this time I'm not classifying this to be a showstopper, and will collect more reports before committing fixes and patching v10. Thanks for the report, Simon, and for the analysis, Brian!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.