#Variable keeps going to 0

1 messages · Page 1 of 1 (latest)

summer plume
#

My variable, CurrentFunc, keeps resetting to 0, causing the highlighted code to not work. Why is that, and how do I adress the issue?

uneven hedge
#

On line 8, since you use var, you are accidentally creating a new local variable instead of changing the one you already have. Also, line 10 prioritizes local variables, so it shows the local’s value 1 instead of your old value of 0.

To fix, remove the var:
CurrentFunc = 1

summer plume
#

Oh I didn't even notice that error, thank you