Hello, recently I've read up some on button activators, and how to implement them into code, but one thing I was wondering is if it is even possible to do an if else statement with a button activator?
Psuedo of what I'm thinking:
If(button is pressed)
{Do this code}
Else
{Do this code}
I'm also curious about if there is a code to be able to do chunks of code with a button activator, thanks to anyone who cn shed some light on this:-)
There is an "else" code type but I've heard that it doesn't work as expected.
Your best bet is to do two if statements. e.g.
if (a pressed)
{ do first code }
end if; if (a not pressed)
{ do second code }
---
Depending on your code, you may also be able to get away with just one if. For example, you could do
{ do second code }
if (a pressed)
{ do first code }
In this case, if a is pressed, the first code will "overwrite" what the second code did.
28XXXXXX YYYYZZZZ
>CODE<
E2100000 00000000
>ANTI CODE<
E0000000 80008000
This works, I´ve used it multiple times. ;D