This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
It helps to calculate the remainder for any movements greater than the list of items. When calculating net movement, be sure to take number of items - 1 so that you don't count the current item in your list again.
1. Needed to setup data with base and iteration input 2. Did the length of string as my iteration write output, sample was 7, so it would write out 7th example/5000/50000th etc 3. Iteration = record ID 4. Set order as base 0 5. The mod function was key: if [Current_Order] >= [Length] then Mod(Current_Order, ([Length]-1)) elseif Current_Order < 0 then Mod(Current_Order, ([Length]-1))+[Length]-1 else [Current_Order] endif
- Figure out the new position by using a mod operator. - take the current position; add the delta; and then mod this with 1 less than the record count - then insert this in the list just ahead of this calculated position (e.g. position 3.1) - Renumber the positions - Next turn
Because the move is being done with a mod operator - part 2 works exactly the same as part 1