# Using switch statement

**URL:** <https://forum.kirupa.com/t/using-switch-statement/257831>\
**Category:** Uncategorized\
**Created:** [April 17, 2008, 3:19pm UTC](https://forum.kirupa.com/t/using-switch-statement/257831 "2008-04-17T15:19:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flaskvacuum](https://avatars.discourse-cdn.com/v4/letter/f/b487fb/32.png) [@flaskvacuum](https://forum.kirupa.com/u/flaskvacuum)\
**Post date:** [April 17, 2008, 3:19pm UTC](https://forum.kirupa.com/t/using-switch-statement/257831/1 "2008-04-17T15:19:02Z")

</div>

```auto

var num:Number = 281;

switch(num) {
        
        case 0: trace("this num a NA");
        break;
        default: switch(num % 2) {
                case 0: switch(num > 0) { // even, positive integer
                        case true: trace("num is both EVEN & Positive integer");
                        break;
                        case false: trace("num is both EVEN & Negative integer");
                }
                break;
                case 1: switch(num > 0) { // odd, negative integer
                        case false: trace("num is both a ODD & Postive integer");
                        break;
                        case false: trace("num is both a ODD & Negative integer");
                }
                
        };
};

```

the above code i can check only with a EVEN number or a -EVEN number. But if i want to check if my number is a negative ODD integer, case 1: doesn’t seem to be activated. Please further advice. I know using if- else is easier but i just want to learn to use CASE statement.
