Same function yields different results on different apps

I'm trying to create a sort function based on Turkish alphabet with the help of ChatGPT. When I test the function in my app, it doesn't yield correct sort order. I tried to create a test app and copied the same function there using backpack. The function works correctly in the test app. I can't figure out what the problem is with my main app. Any help is appreciated.
Here are my blocks form my main app:





TestSortingTurkish.aia (8.7 KB)
this is my test app

Suggest you preload some CSV tables from the Media folder for testing

I loaded one from Google Sheets. Looks like when you manually create a table using add item to list block, the function can sort it but not when you create it using loops. But why?

I found my problem. In my compareStrings block, i should have broken out of the for loop using a "break" block. I updated the function and used the merge sort Now it works like a charm :slight_smile:


I updated two procedures from merge sort like this to use compareStrings procedure:

You can also use "make new sorted list where item1 precedes item2" block to sort any list or list of lists. In the image below I'm using a list of lists. To use it with a single list, remove "select list item" blocks and add item1 and item2 to str1 and str2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.