Saving Data in Standalones
Peter Haworth
pete at mollysrevenge.com
Sun Jun 6 17:53:37 EDT 2010
Not again, I can hear some people saying!
I've just run into this long standing issue in the context of needing
to save the filepath to my database across runs of Revolution and also
various other settings I need to save which are currently in custom
properties.
I'm not concerned about saving my applications data across runs
because I'm using an sqlite database for that. The stuff I need to
preserve is more in the way of internal settings. I'd prefer to leave
them in custom properties if I can because storing them elsewhere will
entail a substantial amount of work to find all the places in my code
where I set and get custom properties and replace the logic with
something else.
I've searched the list archives and the discussion forums and also
read Sarah Reicheldt's revJournal article and Mark Wieders Conference
presentation and still somewhat confused by the solutions to this.
The most common solution seems to be to create a single stack .rev
file that does nothing except invoke the real .rev file and use it as
the basis for the build of the standalone app. But then I see
mentions of that being a problem because of the lack of write access
to the Applications folder (I'm primarily concerned with Macs) so I
look at the permission on my Applications folder and I have full read
and write access to it and the standalone Rev app so am I missing
something?
Then there's the issue of how to implement that solution. I see that
Sarah's article recommends using the "Move substacks into individual
files" option which Mark also describes but then advises against
because of message passing hierarchy problems. So should use that
option or not? And if I do, how do I open the mainstack of my
real .rev file? go stack URL or can I just go stack?
I'm also concerned about what seems to be a huge support issue. If I
understand this method correctly, the .rev file containing the real
application will be just that, a .rev file not a compiled
application. If that's true what's to stop a user of my application
who owns Revolution from changing my application code?
And then I ran across a post on the forum concerning a complication
with this approach related to how to get the datagrid library included
in the app. There's a fairly simple workaround for it but now I'm
wondering what other issues of that nature there might be. How about
the database library for example? And right now, I insert a couple of
front scripts into my app - should that logic stay in the real
application or be moved to the single stack application?
So pity this poor unsuspecting user that thought the IDE might perhaps
warn him if he tried to do something that absolutely would not work in
a standalone application, or perhaps expected that an attempt to save
something that couldn't be saved would at least throw an error in a
standalone application, and believed the user guide section on
building standalones which states "All of Revolution's feature set is
available in a standalone application", followed by a couple of
exceptions which don't include the fact that you can't save data in
them, and the section on global variables that notes that you can't
save them across runs and recommends, amongst other things, saving
them in a custom property if you need to do that.
Help!
Pete Haworth
More information about the use-livecode
mailing list