rivet Posted February 27, 2015 Share Posted February 27, 2015 not sure what to call this but I would like to turn these two arrays: array1: A, B, C array2: 1, 2, 3, 4, 5, 6, 7, 8 into this: 1A, 2B, 3C, 4A, 5B, 6C, 7A, 8B Was playing with: GetValue ( array2 ; loop ) & GetValue ( array1 ; mod ( loop ; ValueCount ( array1 ) ) ) Just get stuck on mod ( 3 ; 3 ) which I can handle with an if statement but would rather let math solve it. Link to comment Share on other sites More sharing options...
GisMo Posted February 27, 2015 Share Posted February 27, 2015 It works with Zero indexed arrays... So your second half should be ... & GetValue(array1; (mod(loop-1;valueCount(array1))+1) loop -1 will simulate zero index array and give you the correct result if you do some shifting: mod(0;3) = 0 ->add 1 to get 1 (a) mod(1;3)=1 -> 2( mod(2;3) = 2 >-3© Hope this helps. Link to comment Share on other sites More sharing options...
rivet Posted March 5, 2015 Author Share Posted March 5, 2015 excellent.... thanks GisMo Link to comment Share on other sites More sharing options...
Lee Smith Posted March 5, 2015 Share Posted March 5, 2015 Hi Gismo, We have a Code button that will allow you to post your code so that it look likes you intended. it is the <> above in the Reply to this topic. Link to comment Share on other sites More sharing options...
GisMo Posted March 5, 2015 Share Posted March 5, 2015 @rivet, glad that did the trick for you! @Lee, Thanks....now where is the "edit" button on my post? Link to comment Share on other sites More sharing options...
Lee Smith Posted March 5, 2015 Share Posted March 5, 2015 (edited) It should appear, along with (Report Blog this, Edit MultiQuote and Quote very light gray in the body. If you don’t see them, just make a new reply to this post and use the Code button and repost the code in it. Edited March 5, 2015 by Lee Smith Link to comment Share on other sites More sharing options...
GisMo Posted March 5, 2015 Share Posted March 5, 2015 @Lee I don't see it for my first post, but I do see them for my recent post earlier today. Is there a reason for that? I'll repost my answer below with code brackets. Answer: GetValue(array1; (mod(loop-1;valueCount(array1))+1) It works with Zero indexed arrays... So your second half should be ... & GetValue(array1; (mod(loop-1;valueCount(array1))+1) loop -1 will simulate zero index array and give you the correct result if you do some shifting: mod(0;3) = 0 ->add 1 to get 1 (a) mod(1;3)=1 -> 2( mod(2;3) = 2 >-3© Hope this helps. Link to comment Share on other sites More sharing options...
Lee Smith Posted March 5, 2015 Share Posted March 5, 2015 @Lee I don't see it for my first post, but I do see them for my recent post earlier today. Is there a reason for that?" I think there is a time limit for members to edit their post. My guess is 24 hours, and or if there has been replies to your post. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 3340 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now