What are switches ment for? (Dialogs).
#2

switch:

A switch statement is basically a structured if/else if/else system (similar to how for is a structured while). The easiest way to explain it is with an example:
pawn Код:
new
    a = 5;
switch (a)
{
    case 1:
    {
        // Won't be called
    }
    case 2:
    {
        // Won't be called
    }
    case 5:
    {
        // Will be called
    }
    default:
    {
        // Won't be called
    }
}
Reply


Messages In This Thread
What are switches ment for? (Dialogs). - by rangerxxll - 17.03.2013, 08:27
Respuesta: What are switches ment for? (Dialogs). - by Parka - 17.03.2013, 08:29
Re: What are switches ment for? (Dialogs). - by mastermax7777 - 17.03.2013, 08:31
Re: What are switches ment for? (Dialogs). - by JaKe Elite - 17.03.2013, 08:31
Re: What are switches ment for? (Dialogs). - by rangerxxll - 17.03.2013, 16:51
Re: What are switches ment for? (Dialogs). - by rangerxxll - 17.03.2013, 18:02
Re: What are switches ment for? (Dialogs). - by Vince - 17.03.2013, 18:22

Forum Jump:


Users browsing this thread: 1 Guest(s)