Overview
The attached program demonstrates how to sort a ListType by using the ListQuickSort function.
Description
The ListType list in the program contains several structs which are created and inserted within the program. None of the comparison functions provided with the ListQuickSort instrument driver will suffice for sorting the structs within the list so a custom comparison function must be defined in the code. This custom comparison function is passed references to 2 items from the list, and it is responsible for returning a value based on a comparison which is used to sort the items in the list. In this example, a list of cars will be sorted based on their year ordered from earliest to latest. The program inserts the cars into the list, sorts them using the ListQuickSort function, and finally prints out the ordered list in the console.
Requirements
Steps to Implement or Execute Code
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.