Saving a stack state and variables

Martin Blackman martinblackman at gmail.com
Mon May 22 07:13:31 EDT 2006


To save global variable values you can save the variable names and
values in a stack field or text file.
When reading them back do some scripting along the lines of

do "put tval into" && tvar

to set your variables.  (tval is a temporary variable which stores the
read-in value of the global and similarly tvar holds the read-in name)

Actually this may be a good illustration of why its often easier to
use custom properties instead of global vars - eg if cloning a stack
the custom properties will automatically be kept.

On 20/05/06, Chipp Walters <chipp at chipp.com> wrote:
> Rob,
>
> You can also always store your data in a stack and save it that way. IOW,
> clone the existing stack with your data and save that stack. Then, you'll
> need to read from it when you 'load' it back.
>
> On 5/18/06, Jim Ault <JimAultWins at yahoo.com> wrote:
> >
> > On 5/18/06 12:49 PM, "Rob Beynon" <r.beynon at liverpool.ac.uk> wrote:
> >
> > > I therefore need to write out to a file the contents of all fields,
> > > and the status of all buttons and menus, as well as some variables.
> > > Because some fields can have many lines, it is not as simple as one
> > > entry per line.
> > > <<full quote below>>
> >
> > One simple technique for saving multi-line entries is to 'pack' them like
> > this...
> >
> > replace cr with "^^" in textBlock  -- of course using a char you choose
> > --now add textBlock to the other content
> >
> > --on reading back to form
> > replace "^^" with cr in textBlock
> >
> > Hope this helps,
> >
> > Jim Ault
> > Las Vegas
> >
> >
> > On 5/18/06 12:49 PM, "Rob Beynon" <r.beynon at liverpool.ac.uk> wrote:
> >
> > >
> > > Hi all,
> > > I have a slightly weird stack
> > > http://www.liv.ac.uk/pfg/LocalTools.html
> > > that does something specific for our research.
> > >
> > > Basically, you enter one field (sequence) or download from the web,
> > > then perform various operations based on choices, to generate an SVG
> > > file that can the be edited externally. It's a bit specialised, but we
> > > like it.
> > >
> > > However, I now want to use save and load menus to save the sequence
> > > and the options in a file, and then reload it to generate that view
> > > sometime in the future.
> > >
> > > I therefore need to write out to a file the contents of all fields,
> > > and the status of all buttons and menus, as well as some variables.
> > > Because some fields can have many lines, it is not as simple as one
> > > entry per line.
> > >
> > > What more sophisticated methods would you suggest? The saved file
> > > doesn't have to be human readable, although that would be a bonus.
> >
> >
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
> >
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list