Checking for BOF and EOF in TinyDB

I have made a lot of progress and wrapping things up.

The only thing left is to add some error trapping like how to check if the DB is empty or not.

This I have done. The only thing I am not sure how to do is how to check for the BOF and EOF as I go forward and backward through the file.

1 Like

don't you use the TinyDB methods to access the database?
http://ai2.appinventor.mit.edu/reference/components/storage.html#TinyDB

you might want to provide a screenshot of your relevant blocks, so we can understand better, what you are talking about...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Here is my Next button.

If you don't want your Next and Previous buttons to wrap around, you can instead change the .Enabled property of those buttons whenever you hit one of the list limits (1, length of list).

  • set ButtonNext.Enabled to (counter < length of list(TinyDB.GetValue('data'))
  • set ButtonPrevious.Enabled to (counter > 1)

Interesting, I'll check into this one.

Thanks

Smthing this way

Populate listOfLists with what is returned from TinyDB, and you can have pagination, using Next and Previous buttons.

1 Like

Thank you for the help. I will try this one as well.

1 Like