From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-30-2015 02:05 PM
I want to stop a while loop after the last element of an array. I cant use the array size way because the size of the array can change within the program. What should I do?
Solved! Go to Solution.
07-30-2015 02:07 PM
Use a For Loop with autoindexing?
Does it have to be a While Loop?
07-30-2015 02:29 PM
Taki1999 mentioned 'For Loop' already. You can activate also the 'Conditional Terminal' of the For Loop, if you need to stop the loop because of any additional condition, like Boolean value, etc...
07-30-2015 02:31 PM
07-30-2015 08:04 PM
Why don't you use the empty array function like this...?
07-30-2015 08:09 PM
@Jimmy.chretien wrote:
Why don't you use the empty array function like this...?
I'm not sure the OP meant to stop the loop when the array is empty. I think they want to stop it after the least element was processed. At any rate, generally use a for loop if you know the size of the array ahead of time, a while loop if you do not.
07-31-2015 07:55 AM
Ok Thanks guys