a == b: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 7: | Line 7: | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| Check if | | Check if one value is equal to another. |= Description | ||
____________________________________________________________________________________________ | ____________________________________________________________________________________________ | ||
| | | valuea <nowiki>==</nowiki> valueb |= Syntax | ||
|p1 = valuea: [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]] | |p1 = valuea: [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]] | ||
Line 25: | Line 25: | ||
} </code> |= | } </code> |= | ||
|x2 = <code> | |x2 = <code>? [[name]] [[player]] <nowiki>==</nowiki> "Billy" : [[hint]] "Hello Billy, how are you?"</code> |= | ||
| |= See also | | |= See also |
Revision as of 17:14, 26 August 2006
Description
- Description:
- Check if one value is equal to another.
- Groups:
- Uncategorised
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
- See also:
- See also needed
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
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."