Example Code

Alphabetical and Numerically Logical String Array Sort

Code and Documents

Attachment

Sorts string arrays the way people normally expects them to be sorted. Numbers in the strings are treated and compared as numbers. The standard sorting functions and many operative systems do not do this properly (In Windows this has so far only been fixed in the Explorer that comes with XP...).

The sorting algorithm used is a stack based Quick Sort so it runs very fast. Implementing it using recursive VI calls is more elegant, however due to the number of calls involved and the overhead of such recursive calls in LabVIEW the sorting is much faster this way.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.