Runtime error comparision


What function it's making this error

This is an interesting error given that this string doesn't appear anywhere in our code base as far as I can tell. Are you using extensions in your application?

3 Likes

Great find @Anke, interesting stuff :slight_smile:


then how to repair this? its always been working well

Are all the items at index 2 numbers ? If they are what type of numbers ? If they are not, then it is possible the comparision / sort will fail.

Also there are now built-in blocks for doing such a sort:

http://ai2.appinventor.mit.edu/reference/blocks/lists.html#sort

im storing numbers of victories, tag is playerName and value is victories

i have always been used the listUtil extension and its been working great

Please provide a test project as small as possible which elicits this error and post it into this thread. Please do not provide the big project.

Taifun

test.aia (12.5 KB)
not everytime this bug is happening
and i have 5 tags and values in cloudDB

Then use the buildin block please.
I found this bug previously also, but have no idea for how to fix it :sweat_smile:

ok, how i have to sort it? what blocks buildin

Screenshot_20230408_212317
put your comparator in if socket

image
what to put in x and x2

x-item1 x2-item2

in fact no procedure needed here.

ok, thx

image
image

show original list and sorted list on labels and see if it's sorted.

sorted
image
not sorted
image

how did you show a list? do not use a loop.