List. SortType (FieldName As String, Ascending As Boolean)Sorts a list with items of user defined type. The list is sorted based on the specified field.FieldName - The case-sensitive field name that will be used for sorting. Field must contain numbers or strings. Ascending - Whether to sort ascending or descending. Example: Sub Process_Globals Type Person(Name As String, Age As Int) End Sub Sub Activity_Create(FirstTime As Boolean) Dim Persons As List Persons.Initialize For i = 1 To 50 Dim p As Person p.Name = "Person" & i p.Age = Rnd(0, 121) Persons.Add(p) Next Persons.SortType("Age", True) 'Sort the list based on the Age field. For i = 0 To Persons.Size - 1 Dim p As Person p = Persons.Get(i) Log(p) Next End Sub B4J Question list sorttype - tufanv    Nov 21, 2017 Hello,
I have a list like this when i log the list:
log:(ArrayList)
As I can see there is a VOLUME24HOUR in the fields but when i use
Exchanges.SortType("VOLUME24HOUR",False)
it says... B4A Question List.SortType() with Localization - Erel (first post)    Feb 5, 2018   (2 reactions) It is not possible. If all the relevant field values are unique then you can add them to a list and a map where they the key is the field value and the value is the custom type.
Sort the list and then get the types from the map.... B4A Question [solved] using list.sortType with a class instead of a type - Dave O (first post)    Nov 30, 2017   (1 reaction) Hey @stevel05 , that did the trick, thanks!
FYI, I did find out that if you use sortType, it works fine with numbers. However, if you use sortTypeCaseInsensitive, it treats numbers as strings, so... B4A Question List.SortType converted to Java ? - vdudukov (first post)    Oct 30, 2017   (1 reaction) Dear Erel,
Yes of course, i know that.
I am working with B4A since 2013, and it is my no.1 programm... B4A Question Use a sorted list with SortType ("filename", False) - Erel (first post)    Apr 12, 2016 This by itself is not an error. Does the program crash? Is there any error in the logs?... Other B4i v1.21 is released - Erel    Nov 23, 2014   (15 reactions) B4i v1.21 is now available for download. You can download it with the same links as v1.00. A mail will be sent with the links. This version adds support for designer script and auto scale: http://www.b4x.com/android/forum/threads/designer-script-autoscale-tutorial.47184/ These features make it much simpler to implement flexible layouts. Other improvements: List.SortType / SortTypeCaseInsensitive - Sorts a list made of user defined types. NativeObject.RunMethodWithBlocks, AsBoolean... B4J Tutorial Parsing huge text files - Erel    Nov 24, 2013   (5 reactions) .Match, count + 1) In order to sort the data we will add the data to a list and call List.SortType: Dim list1 As List list1.Initialize For i = 0 To ips.Size - 1 Dim ic As IpAndCount ic.Initialize ic.ip = ips.GetKeyAt(i) ic.count = ips.GetValueAt(i) list1.Add(ic) Next list1.SortType... = ips.GetValueAt(i) list1.Add(ic) Next list1.SortType("count", False) ic....ReadObject(0) End If raf.Close Dim list1 As List list1.Initialize For i = 0 To ips... B4A Question Spinner list position - zed (first post)    Oct 23, 2023 the first.
Type Test(FieldA As Int, FieldB As Int, FieldC As Int)
Dim List As List
List.Initialize
For i = 1 To 100
List.Add(CreateTest(Rnd(1, 5), Rnd(1, 5), Rnd(1, 5)))
Next
List.SortType("FieldC", True)
List.SortType("FieldB", True)
List.SortType("FieldA", True)
For Each t As Test In List
Log($"${t.FieldA} -> ${t.FieldB} -> ${t.FieldC}"$)
Next... B4A Library [B4X] [XUI] xCustomListView - cross platform CustomListView - Erel    Dec 24, 2023   (45 reactions)   tags: CustomListView, xcutomlistbox card, xuiCLV, CUSTOMLIST, Erel, XUI Update: As several other libraries depend on xCustomListView library, it is no longer recommended... features to xCLV. They are listed at the end of this post. Video tutorial: 256437236 xCustomListView is an implementation of CustomListView based on XUI library. It provides all the features of the original CustomListView and it is compatible with B4A, B4J and B4i. https://www.b4x.com.../basic4android/images/SS-2017-12-27_16.20.44.png This class replaces the platform specific CustomListView... Other B4i v7.80 has been released - Erel    Oct 27, 2021   (27 reactions) I'm happy to release a new version of B4i. Improvements: Support for Xcode 13. Long hex literal numbers: 0xff00ff00ff00 New methods: Bit.OrLong / AndLong / XorLong / ShiftLeftLong / ShiftRightLong / NotLong / UnsignedShiftRightLong / ParseLong List.SortType - stable sort. This means that equal items retain their order. It allows sorting by multiple fields. Fix issue with Unicode sorting and string comparison (https://www.b4x.com/android/forum/threads/b4x-trie-based-search-dialog.134220... Page: 1   2   3   4   5   6   7   |