Select list item:list index too large

why i am getting this error? its because my global variable are initiate in 0?

you are trying to get the item 1 from an empty list. Check "prueba" and/or "name" lists.

what about making your blocks a little bit more readable?
for example by renaming global variable name to listImages

Also why does label3 still have its default text?
did you not execute Screen1.Initialize?
how are you testing? using the companion app?
when exactly does the error occur? After cliciking button siguiente?

Taifun

i am testing about the elements added in every empty list. so in initalize i am adding the elements. so i dont understand why say that my list is empty if initialize was added?

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

ok i make that but my app working only when i close and again open. the list not empty you can see in this image

the number 4 in block initialize show that both of the empty list have elements. the buttons only activate when i push them

maybe the elements of the list are not added in the empty list?.

You could also simplify your initialise blocks

1 Like

ok thanks i will do that, but my error in my last question. why i am getting a list empty if this will be with elements inside the empty list? is very confuse.

i am getting the error but why the list empty prueba dont have the lists of images if in the block initialize i am set to the empty list the filelist taifun route of list files, why i get a empty list? or how can fix that?

maybe using the block make a list could be work?

Names of variables are important.

Tell us about those two variable names and their purposes.

the only porpouse about the two global variables with empty list is to test the two forms to add into the list the taifun filelist. only that.

Try this example:

simplifyGetFiles.aia (36.7 KB)

and how can get a sorted list to order using ascend and descent about the name of every item that are in disorder. i like to get a sequence order using the alphabet or number order.

i see this example but this works with alphabetic and how can make that? and where can i add a sort list to get order every pick next or previously image

Use the list sort blocks on your list. See the example provided in help for how to do this

when i try inverse sort list i get error using back button


taifunloadimages(1).aia (52.8 KB)

your error message is trying to tell you, that your list is not a list

the make new sorted list from block however is expecting a list

it looks like you are still helpless if an error occurs..
remember to use Do it to debug your blocks

Taifun

to get a sorted list of your images, use a new global variable, for example listSorted like this

set listSorted to make new sorted list from get global name

and use naming conventions to be able to understand your blocks yourself and easier spot errors...
for example rename your global variable name to listImages
and rename global variable prueba to listAllImages

btw it does not make much sense to sort an empty list, does it?

Taifun

to use a images sort list. i am need to use two differents lists? one for use a sort list and the other to select the list?