If/Else statement for button activator

Started by oromis, April 05, 2012, 11:03:32 PM

Previous topic - Next topic

oromis

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:-)

dcx2

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.

Bully@Wiiplaza

28XXXXXX YYYYZZZZ
>CODE<
E2100000 00000000
>ANTI CODE<
E0000000 80008000

This works, I´ve used it multiple times. ;D
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully