Select list item: Attempt to get item number 0, of the list

howto

#1

Hello again
I am already well advanced but have only one problem left. When the list picker is loaded, I choose nothing and press the back bottem on the phone, the error always comes "Select list item: Attempt to get item number 0, of the list " now have the whole Internet through, but no approach of a solution. Can anybody help me with this?
Greeting Axl


#2

I suppose by default that if you don’t choose anything from the ListPicker then the return value is 0. I also suppose that after you select something, you call this item from a list. So before call that list, insert an IF statement such as
IF ListPicker1.Selection > 0 then
Select.Item from a List
Else
Do nothing or anything you would


#3

Hello
Thank you for your prompt reply.
I get the data from a csv.
I understand it from the logic, but where do I build this, or how? Unfortunately, I’m still a beginner in the topic.
have a picturebild
Greeting axl


#4

Try to put all the blocks from When ListPicker1.AfterPicking inside an IF Statement
IF ListPicker1.Selection > 0 then
blah, blah, blah


#5

Hello…
I still have a mistake
get this error message now


greeting axl


#6

Try this.
At ListPicker1 BeforePicking
put an initialization
Set ListPicker1.Selection to 0
as first line.


#7

Hello
does not work, it is always the 0 is selected
greeting axl


#8

Try this.
At ListPicker1 BeforePicking
put an initialization
Set ListPicker1.Selection to " "
as first line.


#9

Hello
I did, unfortunately same problem.
But I have the entry (Try to put all the blocks from When ListPicker1.AfterPicking inside an IF statement) removed
greeting axl


#10

So, are you…

or…

Choose one! :wink:
To me looks like the second one.

Put the validation right before the error happens.
The error happens when you try to SELECT the value 0 from a list, so BEFORE THE SELECT, put an IF block asking if the selection =/= 0 then do the select, else don’t do it or do something else.


#11

Also, What are the items in the listpicker?
Post the values you put in the listpicker items please.


#12

Sorry,
I am well advanced in the project, but I am still a beginner.
I have already tried a lot, default to 1, if 0 then +1 - but he does not want.
Is there really something happening, if I choose nothing and just click the back button. What I do not understand, I build that in MIT AI2 it works without that I have to do something.
the list picker loads a csv from the web containing geopositions and links.
greeting axl