Maya for 3D Printing - Rapid Prototyping
In this course we're going to look at something a little different, creating technically accurate 3D printed parts.
# 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!
# 2 09-12-2003 , 09:27 AM
Pony's Avatar
Subscriber
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
Hopefully someday soon I will know enufe about mel to give some kind of responce.. sorry ATM..

# 3 09-12-2003 , 02:26 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
No worries, Pony. I am 99.9% sure that this is a bug. I found a workaround though. The trick is to convert the test variable into a string:
Code:
{
   int $a = -5;
   string $b = $a;

   switch($b)
   {
   case "-5":
        print("\n$a was -5\n");
        break;
   default:
        print("\n$a was some other number\n");
   }
}


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 4 10-12-2003 , 09:27 AM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Yup, it's a bug. Confirmed by an Alias software developer. Since there is a workaround (see above), it's a low priority bug...


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 5 10-12-2003 , 12:16 PM
Pony's Avatar
Subscriber
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
I still think they should give you something for finding it.. even if your not the first.. er.. at least a darn cookie !!

# 6 10-12-2003 , 03:00 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Hehe... Yeah, I could send them a list of demands user added image

- A Quadro FX 3000 card
- A Lamborchini
- A nice and peaceful house near the ocean
- 100 cases of beer

user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 7 10-12-2003 , 03:26 PM
cavalt's Avatar
Registered User
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 74
100 CASES OF BEER!!!!!




Kbrown, we gotta talk.
100 cases of beer is nothing.


10 000 cases of beer!!! Now that's more like it!! He. He.

user added image

# 8 10-12-2003 , 05:22 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
I forgot to mention... 100 cases per week user added image

user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 9 10-12-2003 , 09:24 PM
Pony's Avatar
Subscriber
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
thats a lot of bear.. oh oh.. never mind I see you plan on having partys and inviting Kevin..LOL

# 10 10-12-2003 , 09:54 PM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
user added image


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads