|
Equal
(= =)
This
operator is used to check for equality.
Syntax
:
expression 1 = = expression 2.
Example:
a = "galaxy"
b = "galaxy"
if (a= = b)
{
trace ("galaxy means quality");
}
else
{
trace("sorry");
}
In
the above example, both a and b are checked for equality
and in the output window "galaxy means quality"
will be displayed.
Modulo
(%)
This operator returns the remainder of expression 1
and expression 2.
Syntax
:
expression 1 % expression 2
Example
:
on (press)
{
x = 4;
y = 2;
trace (x%y);
}
From
the above example, the output window will show a result
"0".
Not (Logical)
The
operators invert the Boolean value of a variable or
expression.
Syntax
:
! (expression)
Example
:
on (press)
{
galaxy = false;
if (! Galaxy)
{
trace ("don't worry");
}
}
On
pressing, the button in the output window, the message
"Don't worry" will appear.
Not
Equal
Using
this operator, the opposite of equality operator is
tested.
If
expression 1 is not equal to expression 2 it returns
true.
Syntax
:
expression 1 ! = expression 2
Example
:
5 ! = 8 returns true
5 ! = 5 returns false.
Using
this operator, the opposite of equality operator is
tested.
If
expression 1 is not equal to expression 2 it returns
true.
Syntax:
Expression 1! = expression 2
Example:
5! = 8 returns true
5! = 5 returns false.
|