I want to enumerate a variable as so:
$x = 0
Do
$x+=1
$Day$x = True
Until $x = 7
The above returns a syntax error on $Day$x (because it’s only supposed to see one variable in the command). So basically, I want $Day1 = True, $Day2 = True, so on and so forth. Is there a way to accomplish this?
Welcome to the wonderful world of arrays.
You can actually do what you originally described with $Day1, $Day2, $Day3 but it would be a very bad programming practice and I personally strongly discourage it. That being said, it is possible with the Assign function. You’d be using it for totally the wrong reason. But for completeness, here’s how: