Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 09-12-2003, 08:19 AM   #1
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default 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!
kbrown is offline   Reply With Quote
Old 09-12-2003, 09:27 AM   #2
Pony
Subscriber
 
Pony's Avatar
 
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hopefully someday soon I will know enufe about mel to give some kind of responce.. sorry ATM..
Pony is offline   Reply With Quote
Old 09-12-2003, 02:26 PM   #3
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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!
kbrown is offline   Reply With Quote
Old 10-12-2003, 09:27 AM   #4
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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!
kbrown is offline   Reply With Quote
Old 10-12-2003, 12:16 PM   #5
Pony
Subscriber
 
Pony's Avatar
 
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
Thanks: 0
Thanked 6 Times in 6 Posts
Default

I still think they should give you something for finding it.. even if your not the first.. er.. at least a darn cookie !!
Pony is offline   Reply With Quote
Old 10-12-2003, 03:00 PM   #6
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

Hehe... Yeah, I could send them a list of demands

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

__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 10-12-2003, 03:26 PM   #7
cavalt
Registered User
 
cavalt's Avatar
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

cavalt is offline   Reply With Quote
Old 10-12-2003, 05:22 PM   #8
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

I forgot to mention... 100 cases per week

__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 10-12-2003, 09:24 PM   #9
Pony
Subscriber
 
Pony's Avatar
 
Join Date: Mar 2003
Location: with PonysGirl
Posts: 2,573
Thanks: 0
Thanked 6 Times in 6 Posts
Default

thats a lot of bear.. oh oh.. never mind I see you plan on having partys and inviting Kevin..LOL
Pony is offline   Reply With Quote
Old 10-12-2003, 09:54 PM   #10
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 09:43 AM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 04:41 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.