Hello koders. I’ve got a challenge for you. So basically in A I have a list I created myself ((4 brasil ronaldinho) (1 españa iniesta) (3 argentina messi) (2 francia henry)) - What I do want to do is that based on the first value of each item (4, 1, 3, 2) create a whole new list with that in order. I think I made it okey until point B where I achieve ordering the numbers with the bubblesort, and after that im lost. Any solution please?
P,S; I want the list to be ((1 españa iniesta) (2 francia henry) (3 messi argentina) (4 ronaldinho brasil))
Thank you all for the help, I am already using the extension. Its really important for me to figure out this because I need this to finish my app. So I am pretty close.
First im taking the ranking out and put it in order, and then for each ranking if its contained of each item of the list, i ask to add it on a new list, but it adds the item in the same order and not following the ranking order as you can see it appears ((brasil) (España (argentina) (francia)) and it should be ((españa) (francia) (argentina) (brasil))
It works with more items with no problem .You should know that items are treated as strings so when you want to sort for example numbers , sorting is according to the first digit for example in a list 2,5,3,4,1,10,7,6,8,9 sorting will result as 1, 10, 2, 3, 4, 5, 6, 7, 8, 9 See example below
Hey I appreciate a lot your answer. I tried to apply it to my app but I found another way. Would you tell me why the final result is not ((argentina) (brasil) (chile))? what shoud i modify in order to get to that?
There is a problem with your logic. You only sorted ascending OrdernandoDAscendente but indexing in global PaisesDesordenados remains the same
Actually when you use select list item list index 1 the order of your list is ((Chile 1072220452905) (Argentina 1072010499025) (Brazil 1072120458855)) - see image - so the result is ((Chile) (Argentina) (Brazil))
The procedure you created works like this. For each item in list ((Chile 1072220452905) (Argentina 1072010499025) (Brazil 1072120458855)) meaning
(Chile 1072220452905)
(Argentina 1072010499025)
(Brazil 1072120458855)
and then
For each item in list (1072010499025 1072120458855 1072220452905)
check if contains text and if true add to list
So the hole procedure first checks if (Chile 1072220452905) contains 1072010499025 → result false nothing added to list then checks if (Chile 1072220452905) contains 1072120458855 → result false nothing added to list and then checks if (Chile 1072220452905) contains 1072220452905 → true.
So Chile (index 1) added to list and so on
Hey, I am back, thanks for your solution - I can order the list. But now I can’t select the item Someone told me that the listutils does something that create empty variables, I really didn’t understand. Please take a look.
I don’t know what exactly you are trying to do but the get item block is single item and not a list and hence if your passing it as parameter that requires list then it will obviously produce the error.
If you read above you will see what happens - To give you a quick summary, the first list is disordered, when i order it with list utils, then I can’t select list item
With dora_paz solution I was able to order the list (his solution involved the use of listutils), but not to select list item - So it’s a parcial solution because I need to select list item
I really don’t care about the lenght of the variable’s name, this is just a testing and what I care about is to be able to select list item as I did in the first picture (with the list disordered) but for the second picture (with the list ordered via listutils)
How global ordenalalistaenbaseid is populated ? Please show your blocks
In my example see how list is populated. I can select item 1 but the result is not a list so when I try to get item 1 from that I receive an error. If I wish to get item1 then I use split a spaces block to create a new list and then get item1