a == b

From Bohemia Interactive Community
Revision as of 17:03, 21 May 2006 by Thobson (talk | contribs)
Jump to navigation Jump to search


valuea == valueb


Operand types:

valuea: Number, Group, Side, String or Object

valueb: Number, Group, Side, String or Object

Type of returned value:

Boolean

Description:

Check if valuea is equal to valueb.


Example:

if (player == leader group player) then {hint "You are the leader of your group."} else {hint "Someone else is the boss"}

if (name player == "Billy") then {hint "Hello Billy, how are you?"}


Comments:

Does not work with the types Boolean and Array.

i.e. the arguments:

? MyBoolean == [] : hint "This is a test."

and

? MyArray == [] : hint "This is a test."

...will cause errors.

Instead of the first line use:
? MyBoolean : hint "This is a test."

The workaround for the second line is:
? (count MyArray) == 0 : hint "This is a test."