SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 09-12-2003, 07: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, 08: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, 01: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, 08: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, 11:16 AM   #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, 02: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, 02: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, 04: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, 08: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, 08: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
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.