DataDrid and TimeMachine

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
D4vidrim
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 61
Joined: Fri May 31, 2013 9:32 am

DataDrid and TimeMachine

Post by D4vidrim » Tue Aug 04, 2015 8:55 am

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?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: DataDrid and TimeMachine

Post by Klaus » Tue Aug 04, 2015 11:43 am

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

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: DataDrid and TimeMachine

Post by MaxV » Wed Aug 05, 2015 11:51 am

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.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

golive
Posts: 98
Joined: Wed Jul 01, 2015 5:16 am

Re: DataDrid and TimeMachine

Post by golive » Thu Aug 06, 2015 1:50 am

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)?

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: DataDrid and TimeMachine

Post by MaxV » Thu Aug 06, 2015 8:53 am

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
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

golive
Posts: 98
Joined: Wed Jul 01, 2015 5:16 am

Re: DataDrid and TimeMachine

Post by golive » Fri Aug 07, 2015 1:55 am

Thanks @MaxV
:idea:

Post Reply