#Referencing state variables within variable assignments for that state... looking for an explanation

3 messages · Page 1 of 1 (latest)

stiff creek
#

https://wago.io/zDb60N7RK

The above weakaura is broken, because when setting the 'side' state variable it references index, which is set above, but does not seem to be correctly referencable when initialising other variables within that state. Here we would expect side to be 'Left' but it is actually 'Right'.

Fixed by referring to 'i' rather than 'index'. Why does this not work when referencing index even though it has presumably already been set?

Wago.io is a database of sharable World of Warcraft addon elements

acoustic locust
#

That's how it works in every programming language as far as I know. It isn't already set.

#

It also wouldn't be index, but allstates[something].index