utofaery Posted January 22, 2019 Posted January 22, 2019 (edited) Eg: if an array set has this : setarray .@item_id, 501,502,503,504,505,509,506,507,508,509,510,501; how to turn it to become like this : setarray .@item_id, 501,502,503,504,505,506,507,508,509,510; Note: original Array is actually iteminventorylist so it is not in any sorting orders. Edited January 22, 2019 by utofaery Quote
0 n0tttt Posted January 22, 2019 Posted January 22, 2019 Like this? for(.@size = getarraysize(.@array);.@i < .@size;.@i++) { .@count = countinarray(.@array[.@i],.@array[0]); if(.@count > 1) { .@val = .@array[.@i]; .@k = .@count - 1; do { .@j = inarray(.@array,.@val); if(.@j >= 0) deletearray .@array[.@j],1; } while(.@j != -1 && .@k--); .@size-= (.@count - 1); .@i-= (.@count - 1); } } Quote
Question
utofaery
Eg: if an array set has this :
setarray .@item_id, 501,502,503,504,505,509,506,507,508,509,510,501;
how to turn it to become like this :
setarray .@item_id, 501,502,503,504,505,506,507,508,509,510;
Note: original Array is actually iteminventorylist so it is not in any sorting orders.
Edited by utofaery1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.