10-11-2007 11:26 AM
10-11-2007 01:02 PM - edited 10-11-2007 01:02 PM
Message Edited by smercurio_fc on 10-11-2007 01:02 PM
10-11-2007 01:46 PM
10-11-2007 01:59 PM
10-11-2007 04:58 PM
I agree that the loop count will never go negative, so why and I32 instead of U32? I guess in this case it really doesn't matter, and it would cost time and money for NI to change this or to make it configurable. This would not really a difference in my opinion, therefore it would not be worth NI's time and money.
However, I would like to see the loop step size be configurable, and the starting point be configurable. If I want to start at a point other than 0, or if I want to step by something other than 1, I have to create my own loop counter with shift registers and math functions. Having a configurable starting point and step size would be well worth NI's time to develop, I would think.
10-11-2007 05:30 PM
10-12-2007 07:21 AM
I've wondered the same thing myself before (why a signed int for an always-positive index count?). My best guess on it was that it helps maintain symmetry with some of the array functions.
Specifically, there are array functions such as "Search 1D Array" (and others) which return an index value. When the function fails, it's useful to be able to return an illegal index value of -1, designating "no such index". If those functions returned unsigned ints, they would also need to return a boolean to indicate whether or not the index output is valid.
So..., if array functions might return indices of -1, then other array functions should be able to accept input indices of -1. Thus array indexing needs to accept signed integers. Finally, because a common use of the iteration terminal in a loop is to index into an array, the iteration terminal is also made to be a signed int.
Just a guess, but that's how I've figured it.
-Kevin P.
10-12-2007 10:10 AM
10-12-2007 10:38 AM
10-12-2007 11:10 AM