Page 1 of 1

DataDrid and TimeMachine

Posted: Tue Aug 04, 2015 8:55 am
by D4vidrim
Hi,
I've made a small project with datagrids that show data of the current month, the user can modify some values and save the resulting data on a .rev file.
Then the user can re-open the saved .rev file on the app if he wants to.

What I'd like to do now is to create something like the TimeMachine: letting the user to "surf" different months, just like it is possibile with timemachine (on Mac).

Has anyone already made something similar with datagrids?

Re: DataDrid and TimeMachine

Posted: Tue Aug 04, 2015 11:43 am
by Klaus
Hi David,

this is not Datagrid specific, since you save the complete stack including that datagrid with data :D
I would do something like this:
1. Save a copy of your stack(s) with "the seconds" somewhere in the filename maybe every hour or two or whatever fits your needs e.g. -> datastack_1438684977.livecode
2. then you can read in that folder and display tha dataes that you can generate form "the seconds" part of the filenames.
3. Create a beautiful interface for the user with that info
4. You get the picture :D


Best

Klaus

Re: DataDrid and TimeMachine

Posted: Wed Aug 05, 2015 11:51 am
by MaxV
Dear D4vidrim,
I think that your are walking the wrong path. Easy solution is to separate data from app. Your app should be just a simple interface, the data stored should be in a separate file or files. The easiest way is to use Sqlite database, it's inside livecode so you don't need any extra software or server.
Database are extremely quick to recover huge amount of data, so you can retrieve all you need with a simple SQL syntax. Moreover if you ruin your rev file, you can recover your data in seconds, you make many backups and even compress them with any algorithm you prefer (Zip, 7z, B1, ecc.).
This is just my idea.

Re: DataDrid and TimeMachine

Posted: Thu Aug 06, 2015 1:50 am
by golive
MaxV wrote:The easiest way is to use Sqlite database, you can retrieve all you need with a simple SQL syntax.
I am about to start looking at databases. Any suggestions on useful learning materials?
Is there a sample stack anywhere that shows the basics (e.g. navigation)?

Re: DataDrid and TimeMachine

Posted: Thu Aug 06, 2015 8:53 am
by MaxV
Livecode general code: http://livecode.wikia.com/wiki/SQLite

This is a very good book about SQLite: http://www.amazon.com/Definitive-Guide- ... 1430232250 the second part is about the SQL syntax

Re: DataDrid and TimeMachine

Posted: Fri Aug 07, 2015 1:55 am
by golive
Thanks @MaxV
:idea: