DataDrid and TimeMachine
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
DataDrid and TimeMachine
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?
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
Hi David,
this is not Datagrid specific, since you save the complete stack including that datagrid with data
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
Best
Klaus
this is not Datagrid specific, since you save the complete stack including that datagrid with data

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

Best
Klaus
Re: DataDrid and TimeMachine
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.
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.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: DataDrid and TimeMachine
I am about to start looking at databases. Any suggestions on useful learning materials?MaxV wrote:The easiest way is to use Sqlite database, you can retrieve all you need with a simple SQL syntax.
Is there a sample stack anywhere that shows the basics (e.g. navigation)?
Re: DataDrid and TimeMachine
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
This is a very good book about SQLite: http://www.amazon.com/Definitive-Guide- ... 1430232250 the second part is about the SQL syntax
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w