Fandom

武装突袭 Wiki

Append

简体 | 繁體

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

您使用了广告屏蔽软件!


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

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

Introduced with Arma 3 version 1.40
  

点击图片可看到更多讯息

开始使用于

游戏:
Arma 3
版本:
1.40

描述

描述:
Appends array2 to the back of array1 modifying array1.
NOTE: append does not return array, it modifies existing array. If you need to return a copy, use "+": array3 = array1 + array2;

基本句法

句法:
array1 append array2
参数:
array1: Array

array2: Array
返回值:
Nothing

范例

范例1:
_arr = [1,2,3]; _arr append [4,5,6]; hint str _arr; //[1,2,3,4,5,6]

额外资讯

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

setpushBackpushBackUniqueapplyselectresizereversecountfindinforEachdeleteAtdeleteRangesortparamparamstoArraytoStringarrayIntersectarrayIntersectsplitStringjoinStringBIS_fnc_arrayPushStackBIS_fnc_arrayPush

注意事项

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

Posted on March 9, 2015 - 00:41 (UTC)
Heeeere's Johnny!
_array1 append _array2 is roughly 1.2x faster (depending on array size) than _array1 = _array1 + _array2(Averaged over 10.000 iterations with two identical arrays containing the numbers 0 through 9)

The larger the arrays to append, the faster append is as it does not create a new array, which happens with array addition.

Posted on May 21, 2015 - 10:27 (UTC)
Killzone Kid
Array "unshift" implementation using append, a faster alternative to BIS_fnc_arrayUnShift: KK_fnc_unshift = { private ["_arr", "_tmp"]; _arr = _this select 0; _tmp = [_this select 1]; _tmp append _arr; _arr resize 0; _arr append _tmp; _arr };

// Example arr = [1,2,3]; [arr, 0] call KK_fnc_unshift; //both arr and return of function are [0,1,2,3]

Posted on May 21, 2015 - 15:21 (UTC)
Killzone Kid
Array "insert" implementation using append, much faster alternative to BIS_fnc_arrayInsert: KK_fnc_insert = { private ["_arr", "_i", "_res"]; _arr = _this select 0; _i = _this select 2; _res = []; _res append (_arr select [0, _i]); _res append (_this select 1); _res append (_arr select [_i, count _arr - _i]); _res };

// Example arr = [1,2,3,4]; [arr, ["a","b"], 2] call KK_fnc_insert; //[1,2,"a","b",3,4]

Posted on May 21, 2015 - 15:52 (UTC)
Killzone Kid
A faster alternative to BIS_fnc_arrayPushStack using append: KK_fnc_pushStack = { _this select 0 append (_this select 1); _this select 0 };

// Example arr = [1,2,3]; [arr,[4,5,6]] call KK_fnc_pushStack; //both arr and function return are [1,2,3,4,5,6]

更多维基

随机维基