Thread: Bug in MEL
View Single Post
# 1 09-12-2003 , 08:19 AM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198

Possible bug in MEL

I've posted this to couple of other forums too.

What am I doing wrong or is there a bug in the switch statement?
Code:
{
    int $a = -5;

    switch($a)
    {
    case -5:
         print("$a was -5\n");
         break;
    default:
         print("$a was some other number\n");
    }
}
The above yields to an error message while it shouldn't:
Code:
// Error:      case -5:
//
// Error: Line 6.11: Syntax error //
// Error:      default:
//
// Error: Line 9.12: Syntax error //
// Error: }; //
// Error: Line 12.1: Syntax error //
It seems like you can't use negative values in a case... :saywhat:

case (-5): doesn't work either...


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!