Sorting a list that contains a type

Ricky D

Well-Known Member
Licensed User
Longtime User
I'd like to implement some file functions that would allow me to save my types to files.

B4X:
Type tyepAddmenuItem(Id As Int, MenuItem As String

I understand a List can hold multiple entries of these but I'd like to know how I can sort on either the Id or the MenuItem.

I know this is possible in sqlite but I'd like to get it working with my custom types.

regards, Ricky
 

HotShoe

Well-Known Member
Licensed User
Longtime User
Assuming you named your list flist and added a number of your typed records to it:

flist.sorttype("Id", True)

will sort by the field Id in your type, in ascending order. "MenuItem" will do the same with that field in your type.

--- Jem
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
Thanks, I'll give it a go when I get home

cheers Ricky
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
That doesn't work.

SortType isn't coming up on the List even though the docs say it's there.

I don't know what's wrong.

regards, Ricky
 
Upvote 0

HotShoe

Well-Known Member
Licensed User
Longtime User
What version of b4a do you have?
 
Upvote 0

Ricky D

Well-Known Member
Licensed User
Longtime User
i downloaded the 1.9 trial version.

it works there.

I renamed the core.xml & core.jar files in 1.8

copied them from 1.9

It now works.

regards, Ricky
 
Upvote 0

CharlesIPTI

Active Member
Licensed User
Longtime User
Versioning Shared Jar Files

:sign0013: :sign0085:


Please clarify, ----MORE DETAIL PLEASE-----

are you referring to the Android version that the shared library from java was referencing when it was created as compared to the Android version B4A is referencing ???


What Android version is B4A referencing.

:sign0089:
 
Upvote 0
Top