Recommended way to save data on harddrive?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Recommended way to save data on harddrive?

Post by trenatos » Mon Nov 18, 2013 11:20 pm

I'm working on an app that will need to save data in records to a file, and I'm trying to figure out the best way to approach it.

I think the best idea would be to use SQLite since the app will have many records that the user should be able to flip between, but since I haven't done anything like this before I wanted to ask for input from you guys.
Marcus

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Recommended way to save data on harddrive?

Post by Simon » Mon Nov 18, 2013 11:27 pm

Hi trenatos,
Here is the lesson:
http://lessons.runrev.com/s/lessons/m/4 ... e-database
Pretty cool that if the db does not exists liveCode will just make it for you. Makes it very easy to implement.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Recommended way to save data on harddrive?

Post by trenatos » Mon Nov 18, 2013 11:39 pm

Hi Simon,

Yep seen that one, the only thing missing from it is showing how to move between record-sets, but otherwise that's an excellent tutorial.

I was thinking more along the lines of "Maybe SQLite is overkill" but I'm thinking it's perfect.
Marcus

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Recommended way to save data on harddrive?

Post by Simon » Tue Nov 19, 2013 12:47 am

Hi trenatos,
I'm a big believer in keeping things simple and using a text file is just about as simple as it gets.
I just did a test with loading a text file of 1000 contacts and it takes no time.
i mean

Code: Select all

put the millisecs into t
put url("file:100Contact.txt) into temp
put the millisecs - t into tResult
tResults is 0. Once in a var you can do anything.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply