9.3 Relational operators

Hollywood supports the following relational operators:

Each of the operators compares the operands a and b and returns True if the condition matches and False otherwise. Please note that you can only compare values of the same type. The automatic number to string conversion does not apply here!

The equality operators can be used with all types, i.e. you can also compare functions and tables with them. The order operators (< > <= >=) only work with numbers and strings. If you compare strings with them Hollywood will do an alphabetical comparison. For example:

 
r = ("Hello" < "World")     -> True because H is before W alphabetically
r = ("Commodore" < "Amiga") -> False because C is after A alphabetically

Note that for compatibility reasons, comparing strings with the relational operators is only supported for ASCII characters. To compare strings with full Unicode collation, use the CompareStr() function instead. See CompareStr for details.


Show TOC