| View previous topic :: View next topic |
| Author |
Message |
kadamat Enthusiastic Coder
Joined: 01 Jun 2006 Posts: 88
|
LOL. *whistling sound of bomb dropping* can anyone tell me how to handle a situation where one might want to have multiple options or cases in a logical statement>? If else type stuff.
I have more than two cases though
Reply with quote
|
| |
|
|
Koplaf Enthusiastic Coder
Joined: 28 May 2006 Posts: 130
| |
ovigo22 Enthusiastic Coder
Joined: 15 May 2006 Posts: 130
|
If (condition) { action } else if (condition) { action } else { action }
Ahh .. stuff like that ..
Reply with quote
|
| |
|
|
Mupolan Enthusiastic Coder
Joined: 30 May 2006 Posts: 101
| |
ovigo22 Enthusiastic Coder
Joined: 15 May 2006 Posts: 130
|
If ( this || orthis ) { action } else if ( this && andthis ) { action }
Reply with quote
|
| |
|
|
Roombor Enthusiastic Coder
Joined: 02 Jun 2006 Posts: 111
| |
AmeliaR Enthusiastic Coder
Joined: 31 May 2006 Posts: 142
| |
kadamat Enthusiastic Coder
Joined: 01 Jun 2006 Posts: 88
|
So, could it be if (condition) { action } else if (condition) { action } else { action } -------------and then an infinite number of continued else { action } else { action } else { action } ?
Reply with quote
|
| |
|
|
ovigo22 Enthusiastic Coder
Joined: 15 May 2006 Posts: 130
|
Yeah .. switch if the LHS of the comparison is always the same
kadamat, no, only one will ever get called
Reply with quote
|
| |
|
|
kadamat Enthusiastic Coder
Joined: 01 Jun 2006 Posts: 88
| |
| Page 1 of 3 |
Goto page 1, 2, 3 Next |
|