LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting an Array with 1 element in Lab Windows 8.1

I am using the built in sort, AnalysisLibErrType Sort (double inputArray[], int numberOfElements, int direction, double outputArray[]); to sort an array of doubles.  It is possible for this array to only have 1 element, and when that happens the outputArray returns an empty array.  There are easy workarounds for me, but I didn't see anything related to this on the board so I thought I would bring it up. 

Has anyone else had this happen?
0 Kudos
Message 1 of 4
(2,950 Views)
Also, i forgot to add, the return value is normal (0)  i.e. no error reported
0 Kudos
Message 2 of 4
(2,918 Views)
Hi, Derek,

I have reproduced the behavior on my end. I have already file a bug report with ID 4EEABS6O. Sorry about the inconvenience. If you want to check the status of this bug in the future, you can reference this ID#. It sounds like you've already got a workaround. I would probably check the length of the input array. If it's less than 2, then do not use the sort function. If you need anything else related to this function, let me know.

Song D
Regards,

Song Du
Systems Software
National Instruments R&D
0 Kudos
Message 3 of 4
(2,881 Views)
the array is between 1-5, but yes I have a workaround already, just wanted to let you know about the possible bug.  Thanks.
0 Kudos
Message 4 of 4
(2,860 Views)