Quote:
Originally Posted by [MG]Dimi
It's like this: isn't really meant to be used. Your first example is good. If you have 7 values for one variable and you want for each to do different thing you will use on each but if you want that 6 have same function and one different you will use for one and for the rest . So else is for all values that weren't previously used in if.
|
Wrong. If it wasn't meant to be used, why is it in C, C#, C++, PHP, Pawn, VB Legacy, .Net, ASP, and all the rest of the C based programming languages? It is meant to be used.
Quote:
Originally Posted by ћNJ
There is no difference.
|
Wrong. There is a big difference.
If statements...
Код:
if(blah == 6)
{
//..........
}
if(blah == 7)
{
//sssssss
}
...are all checked in the event of it being true. So if blah is 6, it will still check if its 7.
If Else Statements...
Код:
if(blah == 6)
{
//..........
}
else if(blah == 7)
{
//sssssss
}
...will check if its 6. If it is, it doesn't check if its 7. It will only check if its 7, when blah is not 6.. and it continues.