Page 1 of 2

Int Array Help

Posted: Sun Apr 26, 2015 5:56 pm
by TrojakEW
Hello guys. Can somebody help me with small problem? I need to swap values in integer arrays. I know ho to easilly do this in ruby but i need solution with green primitives since i dont want to use ruby at all.

I need this for module/effect ordering. So for example I have array with six integers 0,1,2,3,4,5 and i need to swap two choosen values. For example 0 with 3. I have tried to do it by myself but no good working soluton.

Re: Int Array Help

Posted: Sun Apr 26, 2015 7:10 pm
by Exo
Inside the Developer toolkit in the Array section is a "Sort integer array" module, have a look at that it uses swapping to sort the array. Maybe you can learn from or modify it for your needs.

Re: Int Array Help

Posted: Sun Apr 26, 2015 11:36 pm
by Youlean
Here you go...

Re: Int Array Help

Posted: Mon Apr 27, 2015 7:21 am
by TrojakEW
Thanks you guys. I will check booth and see what is best for me.

Re: Int Array Help

Posted: Tue Apr 28, 2015 9:07 pm
by TrojakEW
Well I found the same problem in booth version and in my own attempt too while swaping the array. Problem is when I want to use array from output again for another swap. Look in attached file - I used Yoleen example. Try to change index few time and you will see the problem. It will add same value to two indexes after 2 or more changes. How to fix that?

Re: Int Array Help

Posted: Wed Apr 29, 2015 8:55 am
by martinvicanek
Hmm, perhaps a trigger order issue? Here is an alternative using code instead of green.

Re: Int Array Help

Posted: Wed Apr 29, 2015 12:11 pm
by Nubeat7
here is a green version which should work correct

Re: Int Array Help

Posted: Wed Apr 29, 2015 10:30 pm
by Youlean
This should work correctly now in loop.

Re: Int Array Help

Posted: Thu Apr 30, 2015 10:26 am
by TrojakEW
Thanks. Going to test them today.

Re: Int Array Help

Posted: Thu Apr 30, 2015 11:41 am
by MyCo
My version is quite similar to Nubeat7's...