05-19-2016 02:24 PM
Solved! Go to Solution.
05-19-2016 02:31 PM
05-19-2016 02:33 PM
Maybe I'm not understanding, but if you wire it to a for loop and indexing is on, the loop will stop when the last element in indexed in, just don't wire the loop count.
05-19-2016 02:36 PM
If you do wire the lop count, you'd still never exceed the array. You'd just take a subset of the array if the count terminal was a smaller number.
05-19-2016 02:41 PM
Simple answer: compare iteration index with array size.
For more detailed answer we need VI with algorithm (C) Bob
If you are using for loop, you know number of iterations you want to execute. If you want to abort on some condition (file has bad name), you know this condition.
Recursive usually means while loop: you add files to the list and process them one by one. You add to the end of array, process from beginning. You may need to keep counter in shift register and increment it every time you process file.
Check recursive file list.vi from the Advanced file functions, it might help
05-19-2016 03:28 PM
Probably if we knew why you needed to do this, we could give you a much more complete answer.
For instance, if you just need to iterate over the array, autoindexing will cause the loop to exit after the last element of the array was worked on.