Recreating the National Parks example for Appybuilder

howto

#1

I’ve been playing around appybuilder and I tried to recreate the NationalParks example from app inventor. The only problem that I have right now is that I get a “List index smaller than 1 error” which is nuts if you think that it is a literal step-by-step copy. Is there any way I did something wrong?

Here are my appybuilder blocks

NationalParks.aia (991.9 KB)


#2

I don’t think anyone will go thru all your blocks. Part of your job as a programmer is to debug your code. So, start from where the app starts and in a paper write the name of the variable and its value. Follow the blocks execution as if you are your device. When a variable changes its value, scratch the previous and write the new one.
The error says that a list block received a 0 or negative number for the index (item number). And that is not correct. Lists item is always 1 or higher. If the list is empty, there’s no item 0. It’s simply empty. Good luck.


#3

I fixed the bug, it was trivial, but thanks for the note. In the future I won’t be posting trivial issues.

As for the answer, I imported the aia from app inventor and called it a day.