Having trouble building an app

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Having trouble building an app

Post by oldummy » Thu Dec 24, 2020 7:04 pm

I have made a stack with one substack. The main stack simply has a button to go to the other stack. All works fine, but when I build the application I wind up with two stacks and no application. I have made applications in the past and never had trouble with this. Has anything changed in the application builder in the last 3-4 years?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Thu Dec 24, 2020 7:49 pm

Could you tell us:

What computer operating system you are using?

What version of LiveCode you are using?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10319
Joined: Wed May 06, 2009 2:28 pm

Re: Having trouble building an app

Post by dunbarx » Thu Dec 24, 2020 10:17 pm

Hi,

Does the build process do its thing, that is, a dialog or two show up with an indication of activity? Or does nothing happen all?

Craig

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Fri Dec 25, 2020 3:23 am

I'm running livecode 9.6 on windows 10.
Also the application runs builder runs with all the dialogues I always had, and says it's successful. Creates the app folder with two stacks in it instead of the app file with the stack file in the folder 'DATA'

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Fri Dec 25, 2020 11:27 am

With all of my thrashing about with this problem I have fooled myself into writing my previous post wrongly. My apologies. This I hope will clarify what is going on.

I uninstalled and reinstalled livecode 9.6.2.
My stack(a very simple one) is simply somewhere to record my blood glucose levels.
My mainstack is "Blood Sugar" and the substack is "Blood Sugar Record"
My stack script in the mainstack had only to do with positioning the substack and saving it, but I commented all of the stack script out.
In the card script of the main stack is the following:

on closeStackRequest
close this stack
end closeStackRequest

The only other script in the stack is the one button that takes me to the stack where my readings are recorded. It is simply:

on MouseUp
go stack "Blood Sugar Record"
end mouseUp

In the development environment all works as it is supposed to.
When I build the application,clicking the "Go to Record" button does nothing.
The substack is in the data folder as it should be, the application is where it is supposed to be.I can open the substack in the development mode and it works, but when I open the application and try to get to the substack, it does nothing.
I have looked for typos and extra spaces but can find nothing.

SparkOut
Posts: 2946
Joined: Sun Sep 23, 2007 4:58 pm

Re: Having trouble building an app

Post by SparkOut » Fri Dec 25, 2020 11:46 am

Merry Christmas

I don't know what the problem is for you but I wonder if the messages triggered during the standalone builder processes are having an effect, in some way connected to the issues noted here: http://forums.livecode.com/viewtopic.ph ... 3&p=198447

Also, maybe just wondering, given your earlier posting, have you got a tick in the box in the standalone builder settings "Stacks" tab to "Move substacks into individual stackfiles"?

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7391
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Having trouble building an app

Post by jacque » Fri Dec 25, 2020 5:21 pm

A substack is a stack that is part of the same file on disk as the mainstack, not its own separate file. Since you mention it belongs in a Data folder it sounds like it isn't really a substack. How your app behaves will depend on where the stack is located.

If it isn't a substack, there could be different things happening when you close the mainstack. Can you verify whether the data stack is separate from the mainstack?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sun Dec 27, 2020 12:35 pm

Originally, there were two stacks, which is why I suppose I was getting two stacks at finish. Now the there is only one stack when I build. They are both shown in the "stacks" section. I do have "move substacks into individual stackfiles" selected as well as "create folder for stackfiles (data). Also I have "set destoystack to true" selected.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Sun Dec 27, 2020 12:51 pm

I do have "move substacks into individual stackfiles" selected
THAT is where you are going wrong.

Your substacks must stay substacks.

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sun Dec 27, 2020 1:04 pm

Yes, de-selecting that cured it. I am only just starting to do this again after years of being away. Thank you all. ANyone want to take a guess at that warning about the icon? Thanks again. Hopefully I can go back over my older stacks and remember more.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Sun Dec 27, 2020 1:11 pm

ANyone want to take a guess at that warning about the icon?
Which warning would that be as you have only just mentioned it?

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sun Dec 27, 2020 1:43 pm

Icon warning fixed by choosing use none

And while I thought I was out of the woods with this, the data in my substack will not save.
I have tried to save the data in the substack in so many scripts and have yet to have it save any changes. Here are all of the scripts:

Mainstack script:

on preOpenStack
set the rect of stack "Blood Sugar Record" to the rect of me
choose browse tool
end preOpenStack

on closeStack
save stack "Blood Sugar Record"
end closeStack


Substack script:

On moveStack
set the rect of stack "Blood Sugar" to the rect of this stack
end moveStack

on closeStack
save this stack
quit
end closeStack

Card script of subStack:

on openCard
set the locktext of fld "record" to true
end openCard

on closeStackRequest
save stack "Blood Sugar Record"
quit
end closeStackRequest

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Having trouble building an app

Post by richmond62 » Sun Dec 27, 2020 2:08 pm

Well, I too have never managed to save a substack inwith a standalone.

What I have done is saved data into a text file that can then be read back into a standalone when it is opened again.

oldummy
Posts: 97
Joined: Mon Jun 13, 2016 3:21 pm

Re: Having trouble building an app

Post by oldummy » Sun Dec 27, 2020 3:12 pm

Ok. I do have a working application and substack that does indeed save the data. It's a diary dating back all the way to Hypercard 2.2. Changed it over with Runtime Revolution 4.0. But yes, the folder contains the application and the stack in a folder named "data" and I use it fairly often. I tried to open the data stack in livecode and livecode opens but no stack anywhere in the window. I tried to reinstall rev 4.0 with no luck.
So I suppose I am just out of date and will try to work around this somehow.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7391
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Having trouble building an app

Post by jacque » Sun Dec 27, 2020 6:32 pm

Appps can't save data to themselves on any OS so your original method was correct. You need two stacks, the mainstack and the data stack. When you build a standalone, the mainstack contains all the LC code that runs everything, so when you close it, you are essentially quitting the app. That's why it wouldn't do anything when you clicked the button.

Rather than closing it, just hide it so the standalone can still run things. If you want the data stack to be in a folder, you need to separate the data stack from the mainstack and store it as its own file. Create a folder with the data stack inside it and drop the whole folder into the Copy Files pane of the standalone settings. Your app can access the file as specialFolderPath("resources") & "data/my stack.livecode".

Or alternately, set the stackfiles of the mainstack to recognize where the data stack is.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply