08-16-2017 08:22 AM
I'm trying to generate random numbers, convert them to strings, and then print them to a string with commas separating them. I can build this manually (work in progress), but I'm trying to be more efficient and use a loop/array arrangement. Any advice?
Solved! Go to Solution.
08-16-2017 08:31 AM
Definitely use a loop.
You can output the strings as an array and use Array to Spreadsheet string with a comma as a delimiter.
For writing to individual controls, output, the numbers as an array and use a single Index Array outside of the loop expanded to give you multiple outputs and wire each one up to the individual indicators.
08-16-2017 08:32 AM
Change the format string if you want a different number of decimal places.
08-16-2017 08:36 AM
Would you mind drawing up an example?
I'm thinking that it would be practice to shift the values in to the array by using the loop iteration to index the value. The challenge that I am having is figuring out how to put it together.
08-16-2017 08:37 AM
aputman: Why are you using 15 and not 16? Does the loop start at 0?
08-16-2017 08:43 AM
@Superdude_123 wrote:
aputman: Why are you using 15 and not 16? Does the loop start at 0?
I picked a random number. If you want 16 numbers, the loop needs to run 16 times. The "I" (iteration) terminal will start at 0 but that doesn't matter for what you are doing.
08-16-2017 08:52 AM
@Superdude_123 wrote:
Would you mind drawing up an example?
I'm thinking that it would be practice to shift the values in to the array by using the loop iteration to index the value. The challenge that I am having is figuring out how to put it together.
Aputnam drew what I was thinking. Actually a better version than what I was visualizing.