what does this mean?
#8

pawn Код:
// Alright, say we have some variable
new some_variable = 14;

// Now we need to do different things, depending on what it is.
// A neat way to do this is by using "switch".

// Now we say "alright, I want to compare some_variable to a bunch of things"
switch (some_variable) {
    // Is it 1, 2, or 3?
    case 1, 2, 3: {
        printf("It's 1, 2, or 3!");
    }
   
    // Is it between 5 and 10?
    case 5 .. 10: {
        printf("It's between 5 and 10!");
    }
   
    // Is it 14?
    case 14: {
        printf("It's 14!");
    }
   
    // If it's none of the above "cases"
    default: {
        printf("I'm not sure what it is!");
    }
}
Reply


Messages In This Thread
what does this mean? - by TheMightyEddy - 17.04.2012, 23:40
Re: what does this mean? - by Luis- - 17.04.2012, 23:50
Re: what does this mean? - by TheMightyEddy - 17.04.2012, 23:53
Re: what does this mean? - by TheMightyEddy - 18.04.2012, 06:12
Re: what does this mean? - by Slice - 18.04.2012, 06:18
Re: what does this mean? - by TheMightyEddy - 18.04.2012, 13:48
Re: what does this mean? - by Vince - 18.04.2012, 13:51
Re: what does this mean? - by Slice - 18.04.2012, 13:52
Re: what does this mean? - by kikito - 18.04.2012, 13:52
Re: what does this mean? - by Mark™ - 18.04.2012, 13:53

Forum Jump:


Users browsing this thread: 1 Guest(s)