Set many variables at once
Posted: Wed Mar 24, 2021 2:37 pm
If I have many bool variables named variable_1, variable_2, variable_3 etc. and I want to set all of them to either true or false.
Is there a simple way to do this without using a single line for each variable?
I tried a few things, but ended up making 50 lines just to get it done.
The example below does not work, since the StringToVariable command is not existing, but it shows what I was looking for.
Is there a simple way to do this without using a single line for each variable?
I tried a few things, but ended up making 50 lines just to get it done.
The example below does not work, since the StringToVariable command is not existing, but it shows what I was looking for.
Code: Select all
for i = 1 to 50
variablename$ = "varialble_"..i
StringToVariable(variablename$) = False