You are on page 1of 1

* Todo Application

1. Create a "list" to store our todo list.


Q. What is a list?
A list is simple a data type.

2. Create add button.


Q. What does the add button do?
The add button adds a task to the list.
2.1 Extract the text from the text box.
2.2 Add it to the list.

3. Create update button.


Q. What does the update button do?
It updates a task. i.e. Rename it.
Q. What are the requirements to replace a task?
We need to know its index.
3.1 Get the items index.
3.2 Extract the text and put it in that index location.

4. Create the delete button.


Q. What does the delete button do?
It deletes an item from the list.
4.1 Get the index of the item you want to delete.
4.2 Remove it from the list.

Q. How to display the content of the list in the list view?


Using the "set ListView" block function.

Q. Where is the location of the list variable?


It's stored in the RAM. This means that if I close the application,
everything will be gone.
Q. How to solve this problem?
This problem is solved using Databases (DB).

5. Create the done button.


Q. What does the done button do?
It store the content of the list variable in the DB.
5.1 Create a DB, and give it a name (tag).
5.2 Get the content of the list variable and store it in the DB.

Q. When I reopen my application, how will I display the content of the DB?
This is done using the "when screen1.Initialize" block function.

6. Get the content from the DB. So, we have to give it the name of the DB.
6.1 Store it in the list variable.

Q. But, what if the DB wasn't created, and this is my first time to open the
application?
The create an empty list.

You might also like