rivet Posted February 27, 2015 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.
GisMo Posted February 27, 2015 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.
Lee Smith Posted March 5, 2015 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.
GisMo Posted March 5, 2015 Posted March 5, 2015 @rivet, glad that did the trick for you! @Lee, Thanks....now where is the "edit" button on my post?
Lee Smith Posted March 5, 2015 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
GisMo Posted March 5, 2015 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.
Lee Smith Posted March 5, 2015 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.
Recommended Posts
This topic is 3550 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