Having trouble building an app
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Having trouble building an app
I'm unsure if anything is changed in livecode as compared to Revolution. Does go to stack "whatever" close the stack you are leaving from? It has been a few years since I have done much with this, so I know I have forgotten so much.
So are you saying I can save my stack from the application still as long as I do not make it a substack?
So are you saying I can save my stack from the application still as long as I do not make it a substack?
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Having trouble building an app
If you are opening a substack the main stack will stay open.
Re: Having trouble building an app
Yes, that's right. A built application can't be altered in any way on any OS. That's enforced by the OS for security reasons. Malware would love it if it could change the app to do whatever it wanted.So are you saying I can save my stack from the application still as long as I do not make it a substack?
Documents, which your data stack is, can be altered but only if it is saved outside the app. There are restrictions on where the documents have permissions to be writable. The preferences folder and documents folder are the two that allow apps to modify documents.
That means you may have to copy the data stack to one of those two folders before you can write to them. If the app is just for you, you could just put the stack there manually and not include it in the app at all. If the app is for distribution it's common to include a blank template that the app copies to the documents folder on first launch.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Having trouble building an app
Not necessarily, but the script you posted specifically closes the stack. Since it's destroystack is true, it quits.Does go to stack "whatever" close the stack you are leaving from?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Having trouble building an app
First, thanks for your reply. SInce I never had to do what you suggest in the past I could use some help with what you advised.
"or alternately, set the stackfiles of the mainstack to recognize where the data stack is".
How do I do that?
I take it this will enable me to save the data stack?
This is my only goal at this point.
So thanks for your help here as well as back on the old Revolution board.
I will certainly have to adapt to this but I feel as if I have stepped into the twilight zone while attempting this as I have at least 3 applications with substacks that I have built over the years using the same method I started with this application. That includes the application settings to "Move substacks into stackfiles" and "create folder for stackfiles" And I always wound up with the app folder with the app, an extensions folder and the data folder with the substack in it. I still have and use them. The earliest was built sometime in 2015 and the latest in 2016. They all work fine. App opens, goes to substack and any added or edited data in the substack is saved. I know for certain that I never used folderpaths in any of them.
I assume that somewhere livecode has changed or eliminated this feature at some point. I am thinking of installing 9.0 as that dates back to the time of a successful build to try that.
The strange thing is everybody says it has never been possible.
"or alternately, set the stackfiles of the mainstack to recognize where the data stack is".
How do I do that?
I take it this will enable me to save the data stack?
This is my only goal at this point.
So thanks for your help here as well as back on the old Revolution board.
I will certainly have to adapt to this but I feel as if I have stepped into the twilight zone while attempting this as I have at least 3 applications with substacks that I have built over the years using the same method I started with this application. That includes the application settings to "Move substacks into stackfiles" and "create folder for stackfiles" And I always wound up with the app folder with the app, an extensions folder and the data folder with the substack in it. I still have and use them. The earliest was built sometime in 2015 and the latest in 2016. They all work fine. App opens, goes to substack and any added or edited data in the substack is saved. I know for certain that I never used folderpaths in any of them.
I assume that somewhere livecode has changed or eliminated this feature at some point. I am thinking of installing 9.0 as that dates back to the time of a successful build to try that.
The strange thing is everybody says it has never been possible.
-
- VIP Livecode Opensource Backer
- Posts: 10048
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Having trouble building an app
Different outputs suggest something changed.
The task at hand is to determine whether the part that changed in the the SB settings on the stack file, or the SB code that acts on those settings.
Symptomatically, it superficially appears the change is in the SB itself. But we can't be completely certain of that without a test:
If you were to pull the cRevStandaloneSettings custom property array from both the working and non-working stack files, we could compare them to ensure every element value is identical.
The task at hand is to determine whether the part that changed in the the SB settings on the stack file, or the SB code that acts on those settings.
Symptomatically, it superficially appears the change is in the SB itself. But we can't be completely certain of that without a test:
If you were to pull the cRevStandaloneSettings custom property array from both the working and non-working stack files, we could compare them to ensure every element value is identical.
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: Having trouble building an app
As a test, go back to your original settings. Make everything the same as your other working apps where substacks are saved out to a folder. Then change the command that closes the mainstack to just hiding it instead and see if that works.
Also , turn off destoystack to ensure the mainstack doesn't close.
Also , turn off destoystack to ensure the mainstack doesn't close.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Having trouble building an app
Gaskins,I bought your book! I'm glad to see you are still kicking around with this.
I am afraid I am lost as to how to do what you advise.
"If you were to pull the cRevStandaloneSettings custom property array from both the working and non-working stack files, we could compare them to ensure every element value is identical."
I am aware of and use custom properties, but am unsure of what you are saying.
Jacque, I will try do do what you advise, but I have never had to do it before to make this work, hence my confusion..
Thank both of you.
I am afraid I am lost as to how to do what you advise.
"If you were to pull the cRevStandaloneSettings custom property array from both the working and non-working stack files, we could compare them to ensure every element value is identical."
I am aware of and use custom properties, but am unsure of what you are saying.
Jacque, I will try do do what you advise, but I have never had to do it before to make this work, hence my confusion..
Thank both of you.
Re: Having trouble building an app
I have made two stacks. "Even" (main stqack) and "odd" (substack).
Stack script of main stack "even":
on preopenStack
set the visible of me to true -- else I have to set it's visible to true myself
end preopenStack
The button script on the main stack "even":
on mouseUp
hide stack "even"
open stack "odd"
end mouseUp
There is a button and a field on substack "odd". It's script is :
on mouseUp
save this stack
quit
end mouseUp
No more scripting anywhere of my own.
Stack builder settings:
move substack to stackfiles
create folder for stackfiles "data"
destroystack not selected
End result
The app opens to the original main stack. When I click the button to hide the main stack, the whole thing quits.
Stack script of main stack "even":
on preopenStack
set the visible of me to true -- else I have to set it's visible to true myself
end preopenStack
The button script on the main stack "even":
on mouseUp
hide stack "even"
open stack "odd"
end mouseUp
There is a button and a field on substack "odd". It's script is :
on mouseUp
save this stack
quit
end mouseUp
No more scripting anywhere of my own.
Stack builder settings:
move substack to stackfiles
create folder for stackfiles "data"
destroystack not selected
End result
The app opens to the original main stack. When I click the button to hide the main stack, the whole thing quits.
Re: Having trouble building an app
If you can zip up and post your test stack here we can take a look. Something is off about this.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Having trouble building an app
i can and will post it. I can also upload one of my builds that are data free and working with both application as well as the substack that is being saved. I have at least one that is not password encrypted. Two contain information. but I have two blank versions. I would love to have a guru or two examine
them as this seems so odd to me. I'm not sure how to do this, so some pointers would be helpful.
them as this seems so odd to me. I'm not sure how to do this, so some pointers would be helpful.
Re: Having trouble building an app
What I mean to say is I do not know how to post to board.
Re: Having trouble building an app
To post a stack to the board, you simply zip (compress) it, then below the editor on the forum click on the tab that says "Attachments".
You will see a button that says [Add Files], click on it and browse to your zipped stack. If the stack is not overly large, it will upload. If it is over the limit, you'll see a message saying so.
BTW, you can also just drag a file into the editor window itself, to upload it.
Once done (which ever method you used), you'll see the filename and two buttons, along with a space to put a comment. [Place Inline] will attach your file to the post so others can look at it.

Re: Having trouble building an app
Great. One more question before I do.
Did yo just want something like the two stacks I have just made, or stacks that I have on board here that did in fact build the way I describe. I also have the built application folder with the app and the substack made from them that does work as it is supposed to.
Did yo just want something like the two stacks I have just made, or stacks that I have on board here that did in fact build the way I describe. I also have the built application folder with the app and the substack made from them that does work as it is supposed to.
Re: Having trouble building an app
Although I won't be able to look at the stacks, I suspect the people that would best be able to help you would want to look at the stacks that are giving you a problem 

