Hey avk,
I don't understand why you don't want to use database.
With SQLite you need one file along your executable.
I guess it's just @gcarreno hasn't gotten to the DB components yet.
And I won't get there. My knowledge of Lazarus is not that extensive that I can dive into the Connection/Dataset/Field web.
I honestly can say that I know some stuff about Lazarus/FPC but not to the point I can dish out database components.
I also have to admit that I did, once, try to look at the database realm of code and had to step out due to a head ache. Sorry, I was a coward!!
I'll try to explain why I liked @gcarreno's idea of using JSON.
You like it? Awww, thanks man, quite appreciate it!!
{
"categories":
{
"category1":
{
"word1": {"played": false, "play date": <UnixTime>},
"word2": {"played": false, "play date": <UnixTime>},
...
}
"category2":
{
.....
}
...
}
}
I see you're still insisting on having Category names as object names. I still agree that's a good unique index thing, but....
What if the OP needs to attach some fields to the Category object? Major rewrite,
non?
N'est-ce pas?
The resulting file is ~ 43MB in size, TJSONObject parses it in about 2 seconds on my old machine. If necessary, you can find a faster parser.
So I think the idea is quite good.
Amazing, only 43MB!! My math was a bit off then, I'm glad!!
Cheers,
Gus