Silly
April 26, 2024, 6:34pm
1
Hello. I'm creating a add cart system, then when I'm displaying the cart to other screen this error would come out.
Here's the error even the database is empty this error would display.
Then here if I add to cart then the item 2, or 3 is empty this error would display.
I know the system is trying to get the selected list but it not enough, but I want is even the list is not been met, this would not display.
Here's how I display my Cart to other screen.
Taifun
April 26, 2024, 6:38pm
2
before selecting something from a list make sure, the list is long enough... use the length of list block...
how do you store the list?
your list has one item, which is is a list of 3 items
(copied from imagnity.com , courtesy of @Saj )
List Blocks On App Inventor
by Sajal Dutta | app-inventor , tutorials | 102 comments
List is a necessity in almost every app regardless of what programming language you use. This is the easiest way to create and manipulate a set of values/items/elements in an ordered fashion. Please go over the reference before we start. In this tutorial, we will learn how to create a list, add new items to a list, display list items, replace an item in the list, re…
Taifun
Silly
April 26, 2024, 6:50pm
3
This is how I save my list.
This is not the updated version but this is same way I save my list.
It's working fine but the problem is that error will always pop up if the user did not save the intended list that system should display in list. For example I have 3 product that I would display, if I only add cart 2 items this error would display when I came to cart page, but when I complete add cart 3 items this would not pop out.
Taifun
April 26, 2024, 7:01pm
4
as you can see yourself in your blocks you have a main list and add a list of 2 items (well, you said it is not the updated version... why do we have to look at old blocks?
learn to work with lists and list of lists, see the tutorial mentioned earlier
Taifun
Silly
April 26, 2024, 7:14pm
5
Sorry about that here the updated version. I'm using my phone earlier that why I can only give the old version Hehehe...
TIMAI2
April 26, 2024, 7:16pm
6
You can just use if Chicken.Visible
, no need to compare texts
If you made some lists of your components, and used the advanced anyComponent blocks, you could easily use just one if statement.
Taifun
April 26, 2024, 7:54pm
7
and use Do it to debug your blocks
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 Taifun.
ABG
April 26, 2024, 7:59pm
8
Please read this tutorial on how to do a cart:
You don't need (or want) a component for every possible cart item.