utofaery Posted January 22, 2019 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 228 Reputation: 19 Joined: 10/27/12 Last Seen: March 17, 2019 Share 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 Link to comment Share on other sites More sharing options...
0 n0tttt Posted January 22, 2019 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 303 Reputation: 118 Joined: 12/10/16 Last Seen: Friday at 02:39 AM Share 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 Link to comment Share on other sites More sharing options...
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 utofaeryLink to comment
Share on other sites
1 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.