How to save text in a stack

Ken Norris pixelbird at interisland.net
Sat Jun 21 21:45:01 EDT 2003


Hi David,

> Date: Sat, 21 Jun 2003 12:27:34 -0600
> From: David Squance <squance at elkvalley.net>
> Subject: How to save text in a stack
> I have just found the little demo stack "Save2Splash" on the RR website,
> and thought it was just what I was looking for.  However, when I turned it
> into a standalone, any text I entered was gone when it was reopened.  Am I
> missing something?
----------
Yes, you're indeed missing something. RR stacks can't save to themselves
like HyperCard does. The reason follows. This stack was created to show one
of two basic methods for saving data, but I think you did it backwards, sort
of.
----------snip
> but my current project has a
> lot of fields on several cards and writing and reloading to and from text
> files would be very cumbersome.
----------
In your circumstance, perhaps so. What you need is for the splash screen to
be the standalone, which has the engine. You just kick it offscreen, but it
still runs the show. You can't save anything to it, and don't need to. The
other stack(s) with your cards and fields is what you'll see and save, but
you have to provide for that. You can make an autosave routine that will
cause the engine to save your changes on closing if you like, but it would
probably be better to get away from that procedure and have the deliberate
"Save/Don't Save/Cancel" thing like virtually all other software has today.
----------
> I guess what I want is it to work like HC
> does, but I want to be able to build a Windows standalone eventually.
----------
I understand, but that won't happen unless you deliberately script it to do
so, like I mentioned above.

Windows programs can't save to themselves.

Macintosh OS' have a resource fork which allows programs to save to
themselves, which is why HC can do that, i.e., save to itself on closing,
but PC OS' cannot. RR uses the MetaCard cross-platform engine, which means
that, in order for there to be consistency for distributing like software on
all platforms, the ability for programs to save to themselves on Macs has
been eliminated.

I hope that sheds some light on your situation.




More information about the use-livecode mailing list