save content of field [SOLVED]

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: save content of field

Post by jacque » Tue Dec 07, 2021 12:27 am

Samuele wrote:
Mon Dec 06, 2021 9:42 pm
anyone has any idea why it doesn't let me save as standalone the splash stack with the working in it?
I've lost track of what you've done so far, but the working stack cannot be a substack. It has to be its own mainstack. You include it in the Copy Files pane of the standalone settings.

I've never seen that dialog before. It looks like the bottom is cut off, is there more info in the dialog that we can't see?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: save content of field

Post by dunbarx » Tue Dec 07, 2021 3:16 am

but the working stack cannot be a substack.
@Samuele I thought we had gotten through that. The "working" stacks HAVE to be stacks living in SEPARATE stack files.

Craig

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: save content of field

Post by stam » Tue Dec 07, 2021 10:38 am

dunbarx wrote:
Tue Dec 07, 2021 3:16 am
The "working" stacks HAVE to be stacks living in SEPARATE stack files
Late in the discussion and tbh TL;DR ;)
so apologies if i'm just re-iterating what's been said before...

@samuele:
As the /Applications folder is often a non-writeable location, you keep your immutable stack (the splash stack which will then become the standalone app) there, and it then calls the mutable working stack which is stored in a writeable location (eg app support folder, documents etc).
So the stacks have to be different files because they have to reside in different directories/folders.

Your immutable splash stack manages launching the main working stack as a normal stack, not as stand alone (obviously on desktop you should cater for the possibility this may not exist so you should have a copy within the your standalone app directory to copy to the desired location etc - less of an issue for mobile...).

To avoid problems originating from preOpen/Open scripts (for example the splash stack calling the mainstack) i found i have to close all stacks, suspend messages (Development menu -> suspend messages), open the splash stack, build my app, then allow messages again. I prefer this to filling my stack with code just to build the app and it works very well for me.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Thu Dec 16, 2021 11:55 am

B"H, thanks to everyone! for now it works B"H!!
Samuele.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: save content of field

Post by dunbarx » Thu Dec 16, 2021 2:49 pm

Trying to stay up to date.

What is B"H?

Craig

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Thu Dec 16, 2021 6:01 pm

nope, i thought it worked, but the fact is i didn't save st standalone the slplash stack, but the working one :roll: :shock: so i tried again and the splash stack doesn't work entirely, it brings me to the working stack but then all the widgets are purple and disabled so i can't go forward on the app, any ideas, (and also when the pc saved as standalone the splash stack it was much less heavy, maybe that's why the widgets won't work 'cause the pc didn't save the standalone correctly, i don't know...)
thanks
Samuele.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Thu Dec 16, 2021 6:04 pm

its a lot stranger because on my "try" splash stack, it worked perfectly and the widgets were shown, but the working stack itself in the "try" was very light difference of the acyual stack i want to save with the splash(the apk is 140 mb) maybe it's for its heaviness... booo
Samuele.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: save content of field

Post by Klaus » Thu Dec 16, 2021 6:18 pm

Did you really add all this to your "SPLASH" stack:
viewtopic.php?f=7&t=36499&start=30#p211119
?
Especially:

Code: Select all

...
start using this stack
...

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Thu Dec 16, 2021 6:30 pm

yep, that's my stack "splash" script

Code: Select all

function isBuildingStandalone
   return (the environment is "development" AND there is a stack "revStandaloneProgress" AND the mode of stack "revStandaloneProgress" > 0)
end isBuildingStandalone

on openstack
   if isBuildingStandalone() then
      exit openstack
   end if
   ## Neccessary so all opened stacks can access the inclusions of stack "SPLASH"!
   start using this stack
   
   ## Prepare filenames:
   ## Stack in RESOURCES
   put specialfolderpath("resources") & "/clickMe.livecode" into tSourceStack
   
   ## Stack in DOCUMENTS folder
   put specialfolderpath("documents") & "/clickMe.livecode" into tTargetStack
   
   ## check if we already opened the app = the WORKING stack is already in DOCS folder
   if NOT (there is a stack tTargetStack) then
      
      ## Now copy the stack to the DOCS folder
      put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
   end if
   
   ## NOW we can open that "new" stack that NOW can be saved
   go stack tTargetStack
   hide stack "SplashSource"
end openstack
Screenshot 2021-12-16 at 18.30.01.png
Samuele.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Thu Dec 16, 2021 6:35 pm

and this
photo_2021-12-16 18.31.52.jpeg
is the view from mobile, you can see the purple rectangle, that's supposed to be a text entry android widget, but there it's just a purple rectangular... (and also the icon in the middle)...
Samuele.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: save content of field

Post by Klaus » Thu Dec 16, 2021 6:56 pm

OK, just wanted to be sure.

Hm, in the "Standalone Application Settings" did you select:
-> Search for required inclusions when saving the standalone application
or
-> Select inclusions for the standalone application

The automatism of the first option does not work reliably, so maybe that is the problem...

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Thu Dec 16, 2021 7:31 pm

Klaus wrote:
Thu Dec 16, 2021 6:56 pm
Hm, in the "Standalone Application Settings" did you select:
-> Search for required inclusions when saving the standalone application
or
-> Select inclusions for the standalone application

The automatism of the first option does not work reliably, so maybe that is the problem...
i tried with both of the options and none of the two work :?
Samuele.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9663
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: save content of field

Post by dunbarx » Thu Dec 16, 2021 8:55 pm

Klaus is right about the automatic inclusion gadget not being reliable. Doing it by hand always works. That said, one must be perfect in selecting ALL the required inclusions.

Craig

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: save content of field

Post by Klaus » Thu Dec 16, 2021 9:03 pm

Samuele wrote:
Thu Dec 16, 2021 7:31 pm
i tried with both of the options and none of the two work :?
So you selected -> Select inclusions for the standalone application and then you manually checked
all neccessary inclusions on the "Inclusions" card in the "Standlone Application Settings"?

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: save content of field

Post by Samuele » Sun Dec 19, 2021 12:19 pm

Klaus wrote:
Thu Dec 16, 2021 9:03 pm
Samuele wrote:
Thu Dec 16, 2021 7:31 pm
i tried with both of the options and none of the two work :?
So you selected -> Select inclusions for the standalone application and then you manually checked
all neccessary inclusions on the "Inclusions" card in the "Standlone Application Settings"?
yes, i did that and now all the inclusions (such as android native field ecc.) seem to work, but "save this stack" doesn't work, not even now that the app has its splash stack, and that was the reason i made the splash stack at first.
to sum up: i added in the standalone settings of the splash stack the "working" stack (in "copy files) then i general ➜ inclusions i selected "Select inclusions for the standalone application", then in the inclusions tab i selected all the required inclusions.
this is the stack script of the "splash stack"

Code: Select all

function isBuildingStandalone
   return (the environment is "development" AND there is a stack "revStandaloneProgress" AND the mode of stack "revStandaloneProgress" > 0)
end isBuildingStandalone

on openstack
   if isBuildingStandalone() then
      exit openstack
   end if
   ## Neccessary so all opened stacks can access the inclusions of stack "SPLASH"!
   start using this stack
   
   ## Prepare filenames:
   ## Stack in RESOURCES
   put specialfolderpath("resources") & "/clickMe.livecode" into tSourceStack
   
   ## Stack in DOCUMENTS folder
   put specialfolderpath("documents") & "/clickMe.livecode" into tTargetStack
   
   ## check if we already opened the app = the WORKING stack is already in DOCS folder
   if NOT (there is a stack tTargetStack) then
      
      ## Now copy the stack to the DOCS folder
      put url("binfile:" & tSourceStack) into url("binfile:" & tTargetStack)
   end if
   
   ## NOW we can open that "new" stack that NOW can be saved
   go stack tTargetStack
   hide stack "SplashSource"
end openstack
and after all this on mobile "save this stack" doesn't work. :D
any ideas?
thanks!
Samuele.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”