Simple case

02/23/2011 14:41 .Guru#16
It was a joke you fucktard(s)..
02/23/2011 15:37 .Kinshi#17
I love how people who don't know shit about programming are making fun of other people that don't know shit about programming because they don't know shit about programming.

Pretty awesome.
02/23/2011 17:09 StarEvaAfta!~#18
Request close, bcuz we dun know any shit bout programming :D
02/23/2011 17:18 _Emme_#19
Quote:
control cannot fall through from one case label
This is because you're not putting a break in the current case, and trying to put another case in the first one. Simply put a break; at the end of the case.

Quote:
"if" gives a warning says "unreachable code detected"
This is because you are putting the if statement in the same bracklets as the case but under the break; Break simply breaks the code within the paragraph.


Example:
Code:
Console.WriteLine("Enter a number");
string colorName = Console.ReadLine().ToLower();
 
switch(colorName)
{
case "black": { Console.WriteLine("You entered black"); break; }
case "yellow": { Console.WriteLine("You entered yellow"); break; }
default: { Console.WriteLine("You entered any color"); break; }
}
02/23/2011 21:48 KraHen#20
Every problem`s source is Navicat.
02/24/2011 00:37 .Beatz#21
Quote:
Originally Posted by KraHen View Post
Every problem`s source is Navicat.
I have never had a problem with navicat and I don't see how it could give anyone any problems...

All it does is insert into MySql, it doesn't contribute to server lag or anything like that -.-
02/24/2011 01:31 .Guru#22
Quote:
Originally Posted by .Kinshi View Post
I love how people who don't know shit about programming are making fun of other people that don't know shit about programming because they don't know shit about programming.

Pretty awesome.
:)
02/24/2011 14:42 Syst3m_W1z4rd#23
Quote:
Originally Posted by .Beatz View Post
I have never had a problem with navicat and I don't see how it could give anyone any problems...

All it does is insert into MySql, it doesn't contribute to server lag or anything like that -.-
My signature speaks the truth. The person who made worlds best source is saying the words.
02/24/2011 20:23 KraHen#24
Quote:
Originally Posted by .Beatz View Post
I have never had a problem with navicat and I don't see how it could give anyone any problems...

All it does is insert into MySql, it doesn't contribute to server lag or anything like that -.-
O really? I never knew that! Thanks, now I don`t have to die stupid!
02/24/2011 21:18 12tails#25
Navicat don't give any problem... what is wrong is MySql... please don't misunderstand it... Navicat is Navicat and MySql is MySql...

>> Navicat = Program to manage mysql,postgreesql,oracle and others...

^^
02/24/2011 21:24 Basser#26
Quote:
Originally Posted by EmmeTheCoder View Post
This is because you're not putting a break in the current case, and trying to put another case in the first one. Simply put a break; at the end of the case.


This is because you are putting the if statement in the same bracklets as the case but under the break; Break simply breaks the code within the paragraph.


Example:
Code:
Console.WriteLine("Enter a number");
string colorName = Console.ReadLine().ToLower();
 
switch(colorName)
{
case "black": { Console.WriteLine("You entered black"); break; }
case "yellow": { Console.WriteLine("You entered yellow"); break; }
default: { Console.WriteLine("You entered any color"); break; }
}
Is dat how it works these days?
02/24/2011 21:31 _Emme_#27
?
02/24/2011 21:36 Syst3m_W1z4rd#28
Emme this is a little funny.
Code:
Console.WriteLine("Enter a number");
Code:
switch(colorName)
02/25/2011 05:21 _tao4229_#29
tl;dr
C# won't let you fall down cases.
srsly.
02/25/2011 05:59 Spirited42#30
Yikes... well here's an example I made if it helps:

Code:
#region Test
switch ((client.Entity.Class / 10) * 10)
{
      case 10:
      case 20:  // you can add them on top of each other to use the same statement.
         dialog.Text("Pay a visit to Old General Yang to learn more info about your upcoming journeys."); 
         break;  // and just use one break.
      case 40:
      case 50:
         dialog.Text("Pay a visit to the Village Gateman to learn more info about your upcoming journeys."); break;
      case 100:
         dialog.Text("Pay a visit to Taoist Star to learn more info about your upcoming journeys."); break;
}
#endregion
I did laugh a little at Emme's "enter a number" example. =p