Page 1 of 1

Standalones are Read-Only?

Posted: Tue Oct 09, 2007 2:42 am
by songe
This changes everything. I'm going to have to rewrite everything from the ground up.

Is there any good news here at all about this?

Posted: Tue Oct 09, 2007 4:29 am
by Lynn P.
Hi Songe ~

You must have been reading in the Rev docs about "Save" where is states:
"You cannot save to a standalone application's file; standalones are read-only."
Once again, the docs left off some important info and it's really needed for those of us coming from a Hypercard background.
Although the main stack can't save data to itself, it can save it to it's sub-stacks, external files, custom properties or an external database.
If you're used to Hypercard standalone which saves it's info automatically to itself, this can be a bit confusing. Heck.. it can be a LOT confusing!
But not to worry... data can be saved, so your standalone is not "read-only".
Read this excellent tutorial by Sarah Reichelt:
http://www.revjournal.com/tutorials/sav ... ution.html

It will tell you everything you need to know. :D

Re: Standalones are Read-Only?

Posted: Tue Oct 09, 2007 6:23 pm
by FourthWorld
songe wrote:This changes everything. I'm going to have to rewrite everything from the ground up.

Is there any good news here at all about this?
All modern operating systems impose the restriction on apps which prevent them from modifying themselves. AFAIK the anomaly was Mac OS 9 and earlier, which suggests that by "rewrite" you're referring to something that had been written in HyperCard?

If so, it's not all that onerous. If you need to keep the data bound to the UI (an architecture not without its own issues for maintenance, which we could explore later), all you have to do is build your standalone as a simple single-stack that does nothing but open another stack file which is the one you want to modify. In less than a minute to make this new standalone stack the issue is resolved.

Almost.

One of the downsides with this model is that many folders on modern OSes don't have write permissions, esp. to the Applications/Program Files folder. So even by separating the standalone from the modifiable UI stack, if the UI stack is to be included in the folder with the standalone you can't guarantee it will be writable.

On OS X, user data is commonly stored outside of the Applications folder, in the Documents, Application Support, or Preferences folder, depending on the nature of the data.

If this app is just for yourself and you're using an account with admin privileges, there will be no problem saving data in the stack even though it resides in the Applications folder.

But if you want to share this app with others, it's OS X, not Rev, that will require changes to accommodate this.