a == b

From Bohemia Interactive Community

Jump to: navigation, search
Editors, please check Policy: Scripting Command Page Syntax.
Introduced in Operation Flashpoint version 1.00

Click on the images for descriptions

Introduced in

Game:
Operation Flashpoint
Version:
1.00

Description

Description:
Check if one value is equal to another.

Both values need to be of the same type.

Syntax

Syntax:
valuea == valueb
Parameters:
valuea: Number, Group, Side, String, Object, Structured Text, Config, Display or Control
valueb: Number, Group, Side, String, Object, Structured Text, Config, Display or Control
Return Value:
Boolean

Examples

Example 1:
if (player == leader group player) then { hint "You are the leader of your group." } else { hint "Someone else is the boss" }
Example 2:
? name player == "Billy" : hint "Hello Billy, how are you?"

Additional Information

Multiplayer:
Behaviour unknown.
See also:
Operators

Notes

Notes

+ Add Note

Only post proven facts here. Use the talk page or the forums for discussions.

Notes

Posted on August 14, 2006 - 14:03
hoz
Comments from before the template conversion.

Does not work with the types Boolean and Array.

i.e. the arguments:

? MyBoolean == true : 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."

Ceeeb
In OFP v1.96, comparison of strings is not case sensitive. Example : "STRINGtext" == "stringTEXT" returns true.

Bottom Section

Personal tools
Buy ArmA now!