SWiSH Player Support
SWF4 or later - Supported Internally
Syntax
expression1 > expression2
Arguments
expression1,expression2 can be numbers, strings or variables.
Returns
Nothing.
Description
Operator (comparison): compares two expressions and determines whether expression1 is greater than expression2; if so, the operator returns true. If expression1 is less than or equal to expression2, the operator returns false.
String constants are converted to numeric unless both expressions are string constants.
Variables are assumed to be numeric. Possibly undergoing a conversion.
Mixed numeric / string comparisons can give unusual results.
If string comparison is intended, use the gt operator.
Sample
The following examples illustrate true and false returns for both numeric and string comparisons.
31 > 10;
// true
10 > 31;
// false
"dog" > "cat";
// true, both string constants so comparison based on string comparison.
c = "cat";
d = "dog";
d > c;
// false. Probably not what was intended as both variables are converted to numeric 0. Use the gt operator.
See Also
gt