Saving data entered into a stack

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

Saving data entered into a stack

Post by Glenn Boyce » Fri Mar 12, 2010 5:22 am

I've set up a really simple little stack with a table field that entered data is saved into. When I set the stack up as a stand alone application it doesn't save the changes i.e. the new data enetred into the field. I have put a closestack script as shown below. What have I done wrong?

Code: Select all

on closestack
  save this stack
end closestack

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Saving data entered into a stack

Post by Dixie » Fri Mar 12, 2010 11:23 am

Hi...

The main stack of your standalone cannot save changes to itself... but a substack can... So, how about using your main stack as a 'splash screen'.... which opens when you open your app... Have a button on the splash screen that opens a sub-stack and closes the 'splash screen'... You are now effectively using the sub-stack as the 'main' stack of your application..

In the stack script of your sub-stack, save the changes you have made, they will be there the next time you run your app.

Code: Select all

on closeStack
   save this stack
end closeStack
Be well

Dixie

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Saving data entered into a stack

Post by BvG » Fri Mar 12, 2010 4:49 pm

Note that "substack" is a specific term in runrev, and substsacks of the mainstack are in the same stackfile, therefore cannot be saved. What you mean is a seperate stack, that is not part of the application itself and gets loaded somewhen.


See also this post that explains stacks.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Saving data entered into a stack

Post by Dixie » Fri Mar 12, 2010 4:56 pm

Bvg...

You are quite correct... I omitted to point this out.

regards,

Dixie

Post Reply