Jump to content
Sign in to follow this  
{Op4}Bsilenced

remove item from array

Recommended Posts

because this is a lil over my head on scripting i pulled this from domination

"thanks xeno"

// remove an item at index position in an ArrayList

// parameters: array var as string, index

// example ["_myArrayList1",_index] call XfArrayListRemoveAt;

XfArrayListRemoveAt = {

private ["_ar","_index"];

_ar = _this select 0;_index = _this select 1;

call compile format ["

%1 set [_index, ""YXZ_DEL_Q_X76""];

%1 = %1 - [""YXZ_DEL_Q_X76""];

", _ar];

};

but this doesnt do what i need it to do..

i need to remove a specific item from an array list no matter what the index pos of the array list is because the array list is gonna change more then once.

so example

_myarraylist = ["array1","array2",etc];

if whatever happened during mission remove "array2" so i can recall..

thanks in advance if anyone can help me here..

Share this post


Link to post
Share on other sites
because this is a lil over my head on scripting i pulled this from domination

"thanks xeno"

// remove an item at index position in an ArrayList

// parameters: array var as string, index

// example ["_myArrayList1",_index] call XfArrayListRemoveAt;

XfArrayListRemoveAt = {

private ["_ar","_index"];

_ar = _this select 0;_index = _this select 1;

call compile format ["

%1 set [_index, ""YXZ_DEL_Q_X76""];

%1 = %1 - [""YXZ_DEL_Q_X76""];

", _ar];

};

but this doesnt do what i need it to do..

i need to remove a specific item from an array list no matter what the index pos of the array list is because the array list is gonna change more then once.

so example

_myarraylist = ["array1","array2",etc];

if whatever happened during mission remove "array2" so i can recall..

thanks in advance if anyone can help me here..

_myarraylist = _myarraylist - ["array2"];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×