Saving Contents of Entire Stack (Window)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Saving Contents of Entire Stack (Window)
how do you set a path to a folder? i use this but there's an error:
on openCard
go stack "MyAppData"
end openCard
on createDataStack
clone stack "try me 1"
set the name of stack "Copy of try me 1" to "MyAppData"
set the fileName of stack "MyAppData"to C:/tmp/
save stack "MyAppData"
end createDataStack
It does not clone the stack.
on openCard
go stack "MyAppData"
end openCard
on createDataStack
clone stack "try me 1"
set the name of stack "Copy of try me 1" to "MyAppData"
set the fileName of stack "MyAppData"to C:/tmp/
save stack "MyAppData"
end createDataStack
It does not clone the stack.
Re: Saving Contents of Entire Stack (Window)
Again-- thanks-- I appreciate the help.
Just in case another newbie wonders across this tread, at some later day, I was wrong.
The sub-stack data CAN be saved.
There is a great tutorial on this, by Klaus. I can't post the links, as I'm too new here,
but if you search for the thread named, "saving substack" you'll find it there.
PS: Oh yes-- the Dictionary!
I was wondering where all the Events were. in LC they're called Messages.
Just in case another newbie wonders across this tread, at some later day, I was wrong.
The sub-stack data CAN be saved.
There is a great tutorial on this, by Klaus. I can't post the links, as I'm too new here,
but if you search for the thread named, "saving substack" you'll find it there.
PS: Oh yes-- the Dictionary!
I was wondering where all the Events were. in LC they're called Messages.
Re: Saving Contents of Entire Stack (Window)
altho you can't use the save command on substacks of your standalone, you can easily use it on other stacks that are not substacks.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
-
- VIP Livecode Opensource Backer
- Posts: 10048
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Saving Contents of Entire Stack (Window)
Does the clone never appear, or does it merely fail to save where expected?
If the latter, it may be the incomplete path:
set the fileName of stack "MyAppData"to C:/tmp/
If the latter, it may be the incomplete path:
set the fileName of stack "MyAppData"to C:/tmp/
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Saving Contents of Entire Stack (Window)
In order to save in a standalone, the working stack must be in its own stack file. Even substacks of a mainStack will not save. But the remedy is simple. You make a mainStack and one or more working substacks. In the standalone application settings, make sure that all substacks are placed into their own "individual stack files". This is a checkbox on the right side of the pane. Now these stacks will still be part of the standalone stack (which cannot be saved) but can themselves be saved.
In the case of a dataGrid, you have to make sure that the "revDatGridLibrary" stack is included. You may have to add this by hand in the stacks pane.
Try it. Make a stack and a substack.ut something on the substack that needs to be saved, like entering data into a field.
In an opencard handler in the mainstack card script, go to the subStack (so it opens at startup).
Makse sure that you have a closeStack handler in the mainstack that saves upon quitting.
In the standalone application settings, you will see the substack in the "stacks" pane. Make sure that the 'move stacks to individual stackfiles" is checked.
Make the standalone. put data into the field. Quit. The data is there when you reopen.
Call back if you need to. The problem is simple to solve, but several things have to be in place.
Craig Newman
In the case of a dataGrid, you have to make sure that the "revDatGridLibrary" stack is included. You may have to add this by hand in the stacks pane.
Try it. Make a stack and a substack.ut something on the substack that needs to be saved, like entering data into a field.
In an opencard handler in the mainstack card script, go to the subStack (so it opens at startup).
Makse sure that you have a closeStack handler in the mainstack that saves upon quitting.
In the standalone application settings, you will see the substack in the "stacks" pane. Make sure that the 'move stacks to individual stackfiles" is checked.
Make the standalone. put data into the field. Quit. The data is there when you reopen.
Call back if you need to. The problem is simple to solve, but several things have to be in place.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 163
- Joined: Tue Jan 26, 2010 10:15 pm
- Contact:
Re: Saving Contents of Entire Stack (Window)
The better trick to have the LC app builder adding the revdatagridlibrary stack is to follow this lesson:
http://lessons.runrev.com/spaces/lesson ... Data-Grid-
This lesson explains how to add a fake "data grid templates" sub stack in a splash screen to force the builder adding the datagrid library.
Best regards,
http://lessons.runrev.com/spaces/lesson ... Data-Grid-
This lesson explains how to add a fake "data grid templates" sub stack in a splash screen to force the builder adding the datagrid library.
Best regards,
TheSlug
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
http://www.aslugontheroad.com - Tutorials, demo stacks and plugins for LiveCode
Data Grid Helper - An intuitive interface for building LiveCode's Data Grids
Excel Library- Extends the LiveCode language for controlling MS Excel
Re: Saving Contents of Entire Stack (Window)
I'm coming into this topic with a hopefully simple request. How do I save text fields only on iOS. Not in a Mac app just iOS.
These Level 1-1, and so on, are changing numbers 1 through 3 and I want to save this in between user sessions.
and that didn't work. I've looked at many tutorials and just haven't been able to strike the right answer.
So if you could help that'd be amazing. I know that some things just aren't easy but I feel like there has to be a simpler way to save some little text fields.
Sample code would be the best but an explanation of how to do save text fields on iOS would be just as good. I would like to say that I have seen the tutorial in RunRev's lesson section. I'm sorry if the answer is in this post but I either didn't understand it or I missed it. I've been trying to finish my app for a while and I keep finding things that I need to do.
Thanks,
Danny
These Level 1-1, and so on, are changing numbers 1 through 3 and I want to save this in between user sessions.
Code: Select all
on preOpenStack
put fld "Level 1-1" + fld "Level 1-2" + fld "Level 1-3" into fld "minApples"
set the defaultFolder to specialFolderPath("preferences")
put fld "Level 1-1" into URL ("file:iphonetest.txt")
put fld "Level 1-2" into URL ("file:iphonetest2.txt")
put fld "Level 1-3" into URL ("file:iphonetest3.txt")
open stack "Main Menu"
end preOpenStack
on closeCard
save stack "Main Menu" as "/Macintosh HD/documents"
set the defaultFolder to specialFolderPath("preferences")
open file "file:iphonetest.txt"
open file "file:iphonetest2.txt"
open file "file:iphonetest3.txt"
end closeCard

So if you could help that'd be amazing. I know that some things just aren't easy but I feel like there has to be a simpler way to save some little text fields.
Sample code would be the best but an explanation of how to do save text fields on iOS would be just as good. I would like to say that I have seen the tutorial in RunRev's lesson section. I'm sorry if the answer is in this post but I either didn't understand it or I missed it. I've been trying to finish my app for a while and I keep finding things that I need to do.
Thanks,
Danny
Re: Saving Contents of Entire Stack (Window)
Hi Danny,
I also highly recommend to go through these stacks to get more of the basics of LiveCode:
http://www.runrev.com/developers/lesson ... nferences/
Of course you want tot write the info to disk then the stack CLOSES
and read in again when the stack starts -> PROPENSTACK!
Please read my comments!
Best
Klaus
I also highly recommend to go through these stacks to get more of the basics of LiveCode:
http://www.runrev.com/developers/lesson ... nferences/
Of course you want tot write the info to disk then the stack CLOSES
and read in again when the stack starts -> PROPENSTACK!

Please read my comments!
Code: Select all
on preOpenStack
## Read prefs if already present:
## Does not work in standalone, so leave it out!
## save stack "Main Menu" as "/Macintosh HD/documents"
## Try to avoid to "set the defaultfolder...", instead concatenate the neccessary pathnames!
## Read three files, if PRESENT!
if there is a file (specialfolderpath("documents") & "/iphonetest.txt")) then
put url("file:" & (specialfolderpath("documents") & "/iphonetest.txt")) into fld XYZ
end if
## Same for other files
## ..
end preOpenStack
on closeCard
## Save info to disk
put fld "Level 1-1" & fld "Level 1-2" & fld "Level 1-3" into fld "minApples"
put fld "Level 1-1" into URL ("file:" & (specialfolderpath("documents") & "/iphonetest.txt"))
put fld "Level 1-2" into URL ("file:" & (specialfolderpath("documents") & "/iphonetest2.txt"))
put fld "Level 1-3" into URL ("file:" & (specialfolderpath("documents") & "/iphonetest3.txt"))
end closeCard
Klaus
Re: Saving Contents of Entire Stack (Window)
I like to thank Klaus for helping me out on saving to a standalone.
I tried the 'save as individual file' method and it finally works. Thank you guys for being so patience and keeping cool. Now I want the 'splash' stack to disappear after, say 2 seconds.
On opencard
go stack "tryMe3"
set the visible of me to 2 seconds
end opencard
I got errors. How should I go about it?
I tried the 'save as individual file' method and it finally works. Thank you guys for being so patience and keeping cool. Now I want the 'splash' stack to disappear after, say 2 seconds.
On opencard
go stack "tryMe3"
set the visible of me to 2 seconds
end opencard
I got errors. How should I go about it?
Re: Saving Contents of Entire Stack (Window)
Hi Choong,
"visible" is a property that can only be TRUE or FALSE!
After you went to stack "tryMe3" the "defaultstack" IS "tryMe3"so you need to:
may write (save stacks) in the Application folder!!!
Best
Klaus
"visible" is a property that can only be TRUE or FALSE!
After you went to stack "tryMe3" the "defaultstack" IS "tryMe3"so you need to:
Code: Select all
On opencard
go stack "tryMe3"
wait 3 seconds with messages
set the visible of stack "Mainstack or Splash stackname here" to FALSE
end opencard
Again, don't forget, this will only work for users with ADMIN rights, since only ADMINSI tried the 'save as individual file' method and it finally works.
may write (save stacks) in the Application folder!!!
Best
Klaus
Re: Saving Contents of Entire Stack (Window)
Hi Klaus
Thanks...this means other users can't really use the app....someone that share the computer without the admin's right.....is this correct? Unless you specify another folder for the sub stacks, right?
Thanks...this means other users can't really use the app....someone that share the computer without the admin's right.....is this correct? Unless you specify another folder for the sub stacks, right?
Re: Saving Contents of Entire Stack (Window)
Hi Choong,
standalone builder can only copy stacks into the distribution folder!
Best
Klaus
This is correct!pmc wrote:Hi Klaus
Thanks...this means other users can't really use the app....someone that share the computer without the admin's right.....is this correct?
Yes, but you need to do this manually (via script in standalone!) somehow, since thepmc wrote:Unless you specify another folder for the sub stacks, right?
standalone builder can only copy stacks into the distribution folder!
Best
Klaus
Re: Saving Contents of Entire Stack (Window)
Hey Klaus,
I actually have been going through that link slowly but surely.
This is some great code but it won't save. I simply copied and pasted this into the card script and ran it on my iPod and simulator to no avail. Also i've noticed that the preOpenCard only runs once so if you open the card then close it, then open it again then it won't go through the script that you have laid out for it. Same with closeStack. I have Exit on Suspend off and file sharing on in the standalone settings and I have it saving it as individual stack files. Am I doing something wrong? Let me know what I can do.
If you need more script let me know and I will post.
Thanks,
Danny
I actually have been going through that link slowly but surely.

This is some great code but it won't save. I simply copied and pasted this into the card script and ran it on my iPod and simulator to no avail. Also i've noticed that the preOpenCard only runs once so if you open the card then close it, then open it again then it won't go through the script that you have laid out for it. Same with closeStack. I have Exit on Suspend off and file sharing on in the standalone settings and I have it saving it as individual stack files. Am I doing something wrong? Let me know what I can do.
If you need more script let me know and I will post.
Thanks,
Danny