Runtime Error: The list cannot get item number 2 of list length 1!

No ,aia export,
no diagnosis.

The first thing I look for when examining a multi-screen app with multiple TinyDBs, is consistency and logic for association of NameSpaces and TinyDB components across screens.

I see inconsistencies between screens' association of multiple TinyDBs, compounded by failure to name the TinyDBs as to content and purpose.

Here was my tour of 2 screens:
Analysis_History

Looking at Home_Screen's blocks, I see homage to the works of the famous Rube Goldberg.

This is a very circuitous attempt to collect what would be a row of a five column spreadsheet,

  • dateTime
  • cost
  • sell
  • collection
  • expense

I will look at the Analysis_History to see how it expects to receive data for analysis, before returning here.

See the multiple nested brackets 4 levels deep?

There are plenty cases in your code where you retrieve a list from a TinyDB tag, and immediately wrap it with a Make A List block.

I suspect you were thinking that maybe it would not be a list, and you wanted to be really sure that it would be a list? Well, what it does is wrap the returned list in a new list, with the old list all in item 1. Do it enough, and you turn what should have been a list into an onion.

This particular error message included an onion with a TinyDB component at its rotten core.
I can't see any place in your code where you store a TinyDB component, so it must have happened in the past. I suggest you clear each and every TinyDB instance in your app, include TinyDB1.

You never needed more than one TinyDB for this app.

Keeping vertical slices of what should have been a table under separate tags is a recipe for disaster, risking loss of synchronization between slices, and spreading selection logic across all slices of the table.

I recommend switching to this tag/value system:

Keep the TinyDB1 tags you use for registration and login.

Keep your daily data in one tag per year (2023, 2024,...) for easy cleanup and speed of access.

Under the year tag, keep a table with one row per Home_Screen entry, with the date, time, and 4 textbox numbers (cleaned up with 0 instead of blank.)

You will have to filter and reshape the data to feed your graphs, a necessary tradeoff to achieve stable data storage.

Learn how to work with tables:

Also, you do not switch screens properly:

1 Like

I had to mention this too ...

To get to your one and only OK button in your data entry screen, I had to plow past dozens of blank Labels in a Horizontal Arrangement, Labels that were never mentioned in blocks, just there for what, padding?

Or is this left over from the Great Label Shortage of 2022?

Were you hoarding Labels?

Don't worry, there will always be new Labels for you.

Also, learn to use alignment and size per centages in Arrangements to line components up to fit any screen size.

In addition, code is for others to read. Use the Rename button in the Designer to rename important components with their type and purpose, like btnOK for that OK button, and txbSell for that Textbox in the data entry screen.

I know a lot of users in this board don't know English, but the debuggers here work in English for the most part, and this would speed up debugging.

1 Like

:clap: :clap: :clap: @ABG

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.