Can I write in code to set the variable to true or false depending on a button I pressed? See example below.
If not, what other ways are there to achieve similar effects? I have already marked the codes for different modes using directives and only want developers to have the option of switching the modes, but now I wish to give the user the option of switching between the modes. The choice of the mode will only be given at the start of the program, and user is not allowed to switch the mode. To switch the mode, he can only restart the program again.
If cannot use directives, what is the fastest way can I use? (note: the statements are all around the solution)
In pseduocode of what I wish to achieve:
void button_click(...){
if(!CONDITION)
CONDITION = true;
else
CONDITION = false;
}
...
#if CONDITION
//mode X with addtional steps
#endif