revlet serialization

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
emmefisch
Posts: 27
Joined: Thu Jul 23, 2009 2:50 am

revlet serialization

Post by emmefisch » Thu Oct 08, 2009 7:06 pm

How can I save from my revlet several cards (with all objects) and reload this cards the next time?

Thanks for your help.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu Oct 08, 2009 11:34 pm

Dear emmefisch,

I'm not sure that this is possible, because a revLet is essentially a standalone and data cannot be saved inside standalones.

In the standalone builder, you can set a permission to save data to a user's hard disk. This is probably the easiest way. Just save text from fields and buttons into one or more files on the user's hard disk and access these files the next time when the revLet loads.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

emmefisch
Posts: 27
Joined: Thu Jul 23, 2009 2:50 am

Post by emmefisch » Fri Oct 09, 2009 8:16 am

Hi Mark

Thanks for your reply.

No, I want save the cards on the server. There will be thousends of cards and I think it will be better, to load only the 4-5 actual cards in the revlet. I think on database or XML or both. But I am not shure - is it possible to store the whole card seperatly in a file and reload ist after? That would be easyer...

Best,

Fredi

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Fri Oct 09, 2009 9:13 am

It's possible to go to stacks from a revlet. so you could have your cards in separate stacks on the server, or even assemble them by cgi server side scripting on the fly (not on-rev, as that can't do stacks yet).
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

emmefisch
Posts: 27
Joined: Thu Jul 23, 2009 2:50 am

Post by emmefisch » Fri Oct 09, 2009 11:29 am

It's possible to go to stacks from a revlet.
Sorry, I am a newbie, how I make this. Thanks.

Fredi

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Fri Oct 09, 2009 11:42 am

it's quite simple:

Code: Select all

go invisible stack URL ("http://yourdomain.ch/yourstack.rev")
copy card "templateCard" to stack "the current stack in the revlet"
look here for a tutorial on stack navigation (number 1):

http://www.runrev.com/developers/tutori ... nferences/
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

emmefisch
Posts: 27
Joined: Thu Jul 23, 2009 2:50 am

Post by emmefisch » Fri Oct 09, 2009 12:16 pm

Thanks, I will try it.

Best,
Fredi

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Post by FourthWorld » Fri Oct 09, 2009 3:36 pm

What's on the cards?

If it's primarily text you may find a simple CGI storing text files for them may do what you need.

With images, you can set the fileName of an image object to a URL so you can store those on your server separately from the stack as well.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply