Same looping statement, starting value at zero, same evaluation but different end result

fixed

#1

1) Give a description of the problem

See title + piston and logs

2) What is the expected behavior?

key0 should be set at 5 after execution, not zero

3) What is happening/not happening?

Strangely, the logs are the same and the end result is different.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.

Anyone can help me understand what’s going on?

EDIT : better log snapshot


#2

define an int variable and use that as index instead of $index. does that fix the issue?


#3

@bangali

I will try and report. I have little faith tho as $index seems to be reacting as desired per the log.

What is weird is that the expresison input field evaluate correctly but the value stored in int[] list key0 is wrong.

What can explain that there’s a difference between the result evaluated in the expression box and the value stored right after?

@ady624 Maybe a bug?


#4

Tried it but same result. I’m still puzzled by the difference between the expression box evaluation and the variable setted right after.

The only list key causing problem is 0, all else are fine.


#5

This zero $index bug is now fixed as of v0.2.101.20171227. It turned out to be impossible to access or set the zero index of any array using a decimal because a series of casting operations resulted in trying to use null for the key instead.