Fandom

武装突袭 Wiki

IsEqualTo

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Introduced with Arma 3 version 1.16
  

点击图片可看到更多讯息

开始使用于

游戏:
Arma 3
版本:
1.16

描述

描述:
Performs strict comparison between var1 and var2 and returns true if equal, otherwise false.

Some differences between isEqualTo and ==:

  • It performs case sensitive comparison on Strings
  • It doesn't throw error when comparing different types, i.e. ("eleven" isEqualTo 11)
  • It can compare Arrays, Scripts and Booleans (alive player isEqualTo true)
  • It can compare non-existent game objects (grpNull isEqualTo grpNull)
  • It can compare Namespaces (As of Arma 3 v1.47)

基本句法

句法:
var1 isEqualTo var2
参数:
var1: Anything

var2: Anything
返回值:
Boolean

范例

范例1:
_arr1 = [1,[2,[3]]]; _arr2 = [1,[2,[3]]]; if (_arr1 isEqualTo _arr2) then {hint "Arrays match!"}

范例2:
if (a isEqualTo b) then {hint "a is equal to b"}; if !(a isEqualTo b) then {hint "a is not equal to b"};

额外资讯

多人游戏:
-
也可以看看:

isEqualTypeAllisEqualTypeAnyisEqualTypeisEqualTypeParamsisEqualTypeArraytypeNameOperatorsinfindsetresizeswitcha == b

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Bottom Section

Posted on July 19, 2014 - 19:48 (UTC)
AgentRevolution
The behavior of "var1 isEqualTo var2" is pretty much equivalent to "var1 in [var2]", plus the ability to compare arrays, and slightly better performance.

Posted on December 3, 2014 - 13:11 (UTC)
Tajin
Simply put, "isEqualTo" is a binary comparison. Therefor it is very fast but only accepts 100% identical matches. In some other languages this is known as "===" instead of "==".
Posted on May 21, 2015 - 11:26 (UTC)
Killzone Kid
A faster, case-sensitive alternative to BIS_fnc_areEqual using isEqualTo: KK_fnc_allEqual = { private ["_arr", "_first"]; _arr = []; _first = _this select 0; for "_i" from 0 to count _this - 1 do { _arr pushBack _first; }; _arr isEqualTo _this };

// Example [[1,2],[1,2],[1,3]] call KK_fnc_allEqual; //false

Posted on May 21, 2015 - 15:30 (UTC)
Killzone Kid
Array "compare" implementation using isEqualTo, a faster, case-sensitive alternative to BIS_fnc_arrayCompare: KK_fnc_compare = { _this select 0 isEqualTo (_this select 1) };

// Example [[1,2,3],[1,2,3]] call KK_fnc_compare; //true

更多维基

随机维基