While I was pesking about how internet is slow (of course, with a slow connexion and many things to do at once ), my brain was searching a solution to that problem (already asked here, but nothing helped me to find a solution I can build):
From a flat text file, how can I build - no - Fill a ListBox with AddFolder when needed.
Time for a simple explanation of my text file contents:
I list in a text file all published issues of a comic book (magazine). There are two kinds of issues:
a. Issue who holds one story,
b. Issues who holds two or more stories.
The text file is - more or less - complete, but I can add easilly some more data to it.
Now the idea that comes to mind:
first, I was seeking a way to make a two consecutive treatments to the loaded text file:
a. Determine which line is a one story only
b. Determine which line have two or more stories.
Then, I started to think that I am in a cul-de-sac (dead-end): I do not think at a way to store these computed data and then use them to fill the ListBox.
<time ellapsed while I was doing internet related stuff >
Then: what if I import the text file data into a data base file ?
Very simple (to think at, right now, but the implemetation ?): I need two tables (Issues + Contents) where each Issue will have an entry in the Issues Table and Contents will have one to many entries for each Record in the Issues Table.
I have details to check, but what do you think about that idea (design) ?
SQLite Table Design
Table Issues: the Record design
One Field for each atom of information I want to store about a magazine (issue #, Main Title, Release Date, Bar Code Label, )
and a Field that will hold a reference (or a serie of references [how can I do that ?]) to the Contents Records affiliated to that issue (one Reference if there is only one story / One Reference for each stories belonging to that Issue).
Table Contents: the Record design
A Reference field that will make the link to the Issue owner,
All fiels needed to store the data I want, related to the Record story (Name, Start date, end date, Source, writer, Painter, source, ).
Once I have filled the SQLite Data Base file, I only have to open it and fill the ListBox with data from the Issue Table (
AddRow) or Issues Table (
AddFolder) and in ExpandRow, read the appropriate number of stories from the Contents Table.
As I wrote earlier, this is the general idea, the code have to be added later.