Can foreach be pass-by-reference?

Wow thanks! I’ve been doing with a lot of nested structures and your solution 1 is what I really need the most.
In the past, it is too cumbersome to set ArrayElem every single time the variable inside the nested structure changes.

1 Like