Mel - Maya Embedded Language

Precendence

precedence is the hiarchy in which operators are evaluated. they are as follows:
( ),[ ] !,++,--
*,/,%,^
+,-
<,<=,>,>=
==,!=
&&
||
?:
=,+=,-=,*=,/=

listed in this list are a few operators I have not covered.

?:
this takes a statement simple if else statement
int $myInt = 10;
string $myAverage;
if($myInt > 20)
$myAverage = "Yes";
else
$myAverage = "No";


print $myAverage;
and reduces it to
int $myInt = 10;
string $myAverage = ($myInt > 20)? "Yes" : "No";

print $myAverage;

+=,-=,*=,/=

This simply adds, subtracts, multiplys, or divides a variable by a given value;
$a += 5;
is the same as
$a = $a + 5;
++=,--

This simply adds, subtracts, multiplys, or divides a variable by a given value;
$a ++;
is the same as
$a = $a + 1;

<Top>