I am building a app to import from a csv file and show the values in the lables from the item selected in the slider.
In the Companion everything works fine but when i compile to apk and install in the cellphone show me this mensage: “Select list item: List index too large Select list item: Attempt to get item number 1 of a list of length 0: ()”
“Reads text from a file in storage. Prefix the filename with / to read from a specific file on the SD card. for instance /myFile.txt will read the file /sdcard/myFile.txt. To read assets packaged with an application (also works for the Companion) start the filename with // (two slashes). If a filename does not start with a slash, it will be read from the applications private storage (for packaged apps) and from /sdcard/AppInventor/data for the Companion.”
I have tried without “/” with one “/” and nothing.
In the phone, the file is located in the internal storage in /Makeroid/assets/.
how can i set to search in internal storage?
I don’t know how but I think the function format is being called somewhere before the event File1.gotText takes place which means that the CSV list Table is an empty list (Its length is 0) and you are trying to get the value of the item at index week (which is 17) which doesn’t exist yet…
I agree with you. The file is uploaded (because in back) i see the values from week 17 but the error mensage is showed!!!
I tried to change the file location with “/” and without “/” and show another mensage " canot find the file…"
One thing that i discovered is when “Slider1.Position Changed” block is disabled, the error is not showed and the values from week 17 are in the labels!!!
I found that the issue is caused by the slider.
Can anyone share the SliderTools Extension v2 from ken. Is no longer avaiable from the links from Appybuilder!
Put everything in Slider1.Position Changed event into an If statement. Use the Is list empty block to check if the variable table is an empty list, if the condition returns false, execute the code.