I have a loop:
if A == 1
A = 2;
end
if B == 1
B = 2;
end
if C == 1
C = 2;
etc…
Now this of course takes ages to write, but if I write it like:
if A == 1 || B == 1 || C == 1
A = 2; B = 2; C = 2;
end
it will change all of the parameters if any of them is equal ‘1’
What I’d like is a simple loop where I can say that if A or B or C or… is equal ‘X’ than the new value of only the one that is equal to ‘X’ changes to the new value, without having to write it like I did in the first example.
Thank you
Maybe if you group them in a vector, you can do: