a == b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (moved to template)
Line 1: Line 1:
<h2 style="color:#000066">''' ''valuea'' == ''valueb'' '''</h2>
{{Command|= Comments
____________________________________________________________________________________________


| ofp |= Game name


'''Operand types:'''
|1.00|= Game version
____________________________________________________________________________________________


'''valuea:''' [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]]
| Check if valuea is equal to valueb. |= Description
____________________________________________________________________________________________


'''valueb:''' [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]]
|''' ''valuea'' == ''valueb'' '''|= Syntax
|p1 = valuea: [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]]


'''Type of returned value:'''
|p2 = valueb: [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]]
| [[Boolean]] |= Return value
____________________________________________________________________________________________
|x1 = [[if]] ([[player]] <nowiki>==</nowiki> [[leader grp|leader]] [[group]] [[player]]) [[then]] {[[hint]] "You are the leader of your group."} [[else]] {[[hint]] "Someone else is the boss"}


[[Boolean]]
|x2 = [[if]] ([[name]] [[player]] <nowiki>==</nowiki> "Billy") [[then]] {[[hint]] "Hello Billy, how are you?"}
|  |= See also


'''Description:'''
}}


Check if valuea is equal to valueb.
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
</dl>


'''Example:'''
<h3 style="display:none">Bottom Section</h3>
 
[[if]] ([[player]] '''==''' [[leader grp|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:<br>
? MyBoolean : [[hint]] "This is a test."
 
The workaround for the second line is:<br>
? ([[count]] MyArray) '''==''' 0 : [[hint]] "This is a test."


[[Category:Scripting Commands|#]]
[[Category:Scripting Commands|#]]

Revision as of 14:50, 14 August 2006

Hover & click on the images for description

Description

Description:
Check if valuea is equal to valueb.
Groups:
Uncategorised

Syntax

Syntax:
Boolean
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:
Return value needed

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:
if (name player == "Billy") then {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

Bottom Section