a == b: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Fixed link)
mNo edit summary
Line 1: Line 1:
{{Command|= Comments
#REDIRECT [[Operators]]
____________________________________________________________________________________________
 
| ofp |= Game name
 
|1.00|= Game version
____________________________________________________________________________________________
 
| Check if one value is equal to another.
 
Both values need to be of the same type. |= Description
____________________________________________________________________________________________
 
| valuea <nowiki>==</nowiki> valueb |= Syntax
 
|p1 = valuea: [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]]
 
|p2 = valueb: [[Number]], [[Group]], [[Side]], [[String]], [[Object]], [[Structured Text]], [[Config]], [[Display]] or [[Control]]
| [[Boolean]] |= Return value
____________________________________________________________________________________________
 
|x1 = <code>[[if]] ([[player]] <nowiki>==</nowiki> [[leader|leader]] [[group]] [[player]]) [[then]]
{
<nowiki>    </nowiki>[[hint]] "You are the leader of your group."
} [[else]] {
<nowiki>    </nowiki>[[hint]] "Someone else is the boss"
} </code> |=
 
|x2 = <code>? [[name]] [[player]] <nowiki>==</nowiki> "Billy" : [[hint]] "Hello Billy, how are you?"</code> |=
 
|  |= See also
 
}}
 
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dd class="notedate">Posted on August 14, 2006 - 14:03</dd>
<dt class="note">'''[[User:Hoz|hoz]]'''</dt><dd class="note">
'''''Comments from before the template conversion.'''''
 
Does not work with the types [[Boolean]] and [[Array]].
 
i.e. the arguments:
 
? MyBoolean <nowiki>==</nowiki> true : [[hint]] "This is a test."
 
and
 
? MyArray <nowiki>==</nowiki> [] : [[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) <nowiki>==</nowiki> 0 : [[hint]] "This is a test."
</dd>
 
<!-- Note Section END -->
</dl>
 
<h3 style="display:none">Bottom Section</h3>
 
[[Category:Scripting Commands|#]]
[[Category:Scripting Commands OFP 1.96|#]]
[[Category:Scripting Commands OFP 1.46|#]]
[[Category:Scripting Commands ArmA|#]]
[[Category:Command_Group:_Math|#]]

Revision as of 00:41, 22 December 2006

Redirect to: