Hello, I understand that TBB does not have a inbuilt function for sorting custom arrays.
Have any of you found a workaround i.e. a custom created TBB function/script to sort your custom arrays since there is no TBB inbuilt sort array function?
Thanks for your help.
Sorting Custom Arrays
If you're going to code your own sort in Blox BASIC, the Shell sorting algorithm is probably a good compromise between simplicity and speed. It's only a tiny bit more complicated than a traditional Bubble sort or Insertion sort, but it runs signigicantly faster, especially when sorting more than two dozen entries. Here is Sedgewick's implementation:
- Attachments
-
- Shell sort: program code in C
- sorting.jpg (36.96 KiB) Viewed 9499 times
Thanks sluggo, while I don't have access to the Customer site... I see that you are a tremednous resource to the tBB community.
I am NOT a prficient C coder.
Do you have a code example I can directly use in TBB.
I am considering purchasing TBB, but given the limited 7 day trial window, I want to be sure I can at least code all my current systems in TBB before downloading the trial version. The array sort feature is important to me.
Thanks again fr your help and please let me know if you have a direct TBB example iusing TBB Basic that I can use to sort my custom arrays.
I am NOT a prficient C coder.
Do you have a code example I can directly use in TBB.
I am considering purchasing TBB, but given the limited 7 day trial window, I want to be sure I can at least code all my current systems in TBB before downloading the trial version. The array sort feature is important to me.
Thanks again fr your help and please let me know if you have a direct TBB example iusing TBB Basic that I can use to sort my custom arrays.
It is a good question. If the list to be sorted is numeric and not strings, and the number of elements do not exceed the number of instruments, there is another possibility involving the functions SortInstruments and SetLongRankingValue (or -Short-).
This use may not be official or recommended but I have made use of it. It is not the all-purpose sort function that you're looking for, but possibly the work-around you're looking for.
If you also use proper instrument ranking in your system, remember to first save the existing ranks and then repopulate them after your custom sort.
This use may not be official or recommended but I have made use of it. It is not the all-purpose sort function that you're looking for, but possibly the work-around you're looking for.
If you also use proper instrument ranking in your system, remember to first save the existing ranks and then repopulate them after your custom sort.
-
- Site Admin
- Posts: 9015
- Joined: Tue Apr 06, 2004 1:41 pm
- Location: Boston, MA
- Contact: