>= (greater than or equal to)
Top  Previous  Next


SWiSH Player Support
SWF4 or later - Supported Internally

Syntax
expression1 >= expression2

Arguments
expression1, expression2 can be numbers, or strings.

Returns
Nothing.

Description
Operator (comparison): compares two expressions and determines whether expression1 is greater than or equal to expression2; if so, the operator returns true. If expression1 is less than 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.

If string comparison is intended, use the ge operator.

The definition of equal depends on the data type of the parameter:
·If both of the two values are strings, they are compared as strings. Otherwise, any strings are converted to numbers before being compared.  
·If the values are numbers, then the values are compared  

Note:
For SWF4 only, comparing a variable and a string will assume the variable also contains a string, and will do a string comparison. For SWF5+ the actual type of value in the variable is used as above to determine how to compare.

Sample
The following examples illustrate true and false returns for both numeric and string comparisons.
31
 >= 31;
// true


10
 >= 31;
// false


"dog" >= "cat";
// true


d = "dog";
c = "cat";

c >= d;
// true, possibly not what is intended as both variables are converted to numeric (0). Use
ge instead.

See Also
ge