a == b: Difference between revisions
Jump to navigation
Jump to search
m (VBS2 scripting category removal) |
(mass edit: removing obsolete </dt> and </dd> tags) |
||
Line 36: | Line 36: | ||
<dl class="command_description"> | <dl class="command_description"> | ||
<!-- Note Section BEGIN --> | <!-- Note Section BEGIN --> | ||
<dd class="notedate">Posted on August 14, 2006 - 14:03 | <dd class="notedate">Posted on August 14, 2006 - 14:03 | ||
<dt class="note">'''[[User:Hoz|hoz]]''' | <dt class="note">'''[[User:Hoz|hoz]]'''<dd class="note"> | ||
'''''Comments from before the template conversion.''''' | '''''Comments from before the template conversion.''''' | ||
Line 57: | Line 57: | ||
The workaround for the second line is:<br> | The workaround for the second line is:<br> | ||
? ([[count]] MyArray) <nowiki>==</nowiki> 0 : [[hint]] "This is a test." | ? ([[count]] MyArray) <nowiki>==</nowiki> 0 : [[hint]] "This is a test." | ||
<dt class="note">'''[[User:Ceeeb|Ceeeb]]''' | |||
<dt class="note">'''[[User:Ceeeb|Ceeeb]]''' | |||
<dd class="note"> | <dd class="note"> | ||
In '''OFP v1.96''', comparison of [[String|strings]] is not case sensitive. ''Example : "STRINGtext" == "stringTEXT" returns [[true]].'' | In '''OFP v1.96''', comparison of [[String|strings]] is not case sensitive. ''Example : "STRINGtext" == "stringTEXT" returns [[true]].'' | ||
<!-- Note Section END --> | <!-- Note Section END --> |
Revision as of 16:49, 17 October 2011
Description
- Description:
- Check if one value is equal to another. Both values need to be of the same type.
- Groups:
- Uncategorised
Syntax
- Syntax:
- valuea == valueb
- Parameters:
- valuea: Number, Group, Side, String, Object, Structured Text, Config, Display or Control; since VBS2 1.24: Location
- valueb: Number, Group, Side, String, Object, Structured Text, Config, Display or Control; since VBS2 1.24: Location
- 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:
- Operators
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." - Ceeeb
- In OFP v1.96, comparison of strings is not case sensitive. Example : "STRINGtext" == "stringTEXT" returns true.
Bottom Section
Categories:
- Scripting Commands
- Introduced with Operation Flashpoint version 1.00
- Operation Flashpoint: New Scripting Commands
- Operation Flashpoint: Scripting Commands
- Command Group: Uncategorised
- Scripting Commands OFP 1.96
- Scripting Commands OFP 1.46
- Scripting Commands ArmA
- Scripting Commands ArmA2
- Command Group: Math
- Command Group: Variables