How would I build a LiveCode application that can update its component stacks with newer versions from a web server? I have seen this mentioned as "easy to do" but have been unable to locate specifics on how it can be down.
Asked
Active
Viewed 622 times
3
-
The problem here is of course that HyperCard (LC's spiritual predecessor) could make classic Mac applications that would safe themselves, so people who are used to that need to relearn a bit. – BvG Sep 06 '13 at 10:29
-
@JayC I tried to edit your question but it was rejected due to too many changes. Have a look yourself and see if you can edit this question to get it reopened again http://stackoverflow.com/review/suggested-edits/2870787 – Mark Sep 06 '13 at 10:57
1 Answers
4
It's just a few lines of code. Open the stack from the server and save it to disk:
go stack url ("http://path/to/server/file.livecode")
set the filename of this stack to <path on disk>
save this stack
If you don't want to actually display the stack, you can just load it into a variable and save that to disk. Be sure to use binary if you do that:
put url ("http://path/to/server/file.livecode") into myVar
put myVar into url ("binfile:" & <path on disk>)
The second method could be reduced to a single line of script.
There's a LiveCode lesson that explains the concepts here: http://lessons.runrev.com/s/lessons/m/4071/l/78702-opening-a-stack-from-the-server

Jacque
- 416
- 2
- 7