using script-only stack in a standalone

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
mattmaier
Posts: 109
Joined: Fri Apr 19, 2013 2:49 am

using script-only stack in a standalone

Post by mattmaier » Thu Oct 29, 2015 4:36 am

Using community 8DP7. I created a new stack and put this in the stack script:

Code: Select all

on preOpenStack
   set the itemDelimiter to "/"
   get the effective fileName of this stack
   set the defaultFolder to item 1 to -2 of it
   
   start using stack "hull_test_lib_1.livecode"
end preOpenStack

on openCard
   lib_1_popup
end openCard
I also created a script-only stack and put this in its script

Code: Select all

on lib_1_popup
   answer "hello world world"
end lib_1_popup
When I close Livecode, to be sure everything is out of memory, then start Livecode and open the first stack I get the popup.
When I save it as a standalone, and run the standalone, I don't get the popup, even if I manually copy the script-only stack into the folder with it.
Am I missing something?

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

Re: using script-only stack in a standalone

Post by jacque » Thu Oct 29, 2015 4:33 pm

It's probably a path problem. Change the "start using" line to this:

Code: Select all

start using stack (specialFolderPath("resources") &  "/hull_test_lib_1.livecode") 
Then make sure you include the file in the Copy Files pane of standalone settings.

If the library stack is in the same folder as the mainstack during development, this line will work in both the IDE and a standalone.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mattmaier
Posts: 109
Joined: Fri Apr 19, 2013 2:49 am

Re: using script-only stack in a standalone

Post by mattmaier » Thu Oct 29, 2015 8:56 pm

I tried just adding hull_test_lib_1.livecode to the copy files list. That made it show up in the standalone application folder with the .exe, but I still didn't get the popup.

Then I tried replacing my start using line with yours. Even with that new line, and the script-only stack in the folder, no popup.

Then I tried removing the lib_1 file from the copy files list and adding it to the standalone folder manually, still with the new start using line. No popup.

It looks like specialFolderPath("resources") is returning the right folder in the IDE, but returning empty in standalone. The defaultFolder returns the same correct folder in both places.

Yeah, I put the file path it tried to use to start using the script-only stack into a text field and it looks exactly right. The file it's supposed to use is in the folder it says it's looking in. No popup. Everything has worked in the IDE; nothing has worked in standalone.

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

Re: using script-only stack in a standalone

Post by jacque » Fri Oct 30, 2015 5:52 pm

It's probably time to submit a bug report in that case. Script only stacks are new and there may be some glitches still.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mattmaier
Posts: 109
Joined: Fri Apr 19, 2013 2:49 am

Re: using script-only stack in a standalone

Post by mattmaier » Fri Oct 30, 2015 9:12 pm

It looks like there isn't a problem with "start using", but rather with the answer dialog. The script-only stack is in stacksInUse and a different handler works.

The answer dialog line is in the script-only stack. The answer dialog appears when I open the normal stack in the IDE, and it appears when I call it from a button on the card after everything is done loading. But the answer dialog doesn't appear either time in the standalone.

So I moved the line of script that creates the answer dialog to the normal stack and made it dependent on a function in the script-only stack. Then all of a sudden both answer popups appeared in the standalone.

Then I removed the line of script that created the answer popup from the normal stack and switched the script back to calling the handler in the script-only stack that created the popup. Again, both popups now appear in standalone.

It turns out there is a checkbox in the standalone application settings for including answer dialogues in the standalone. I didn't think to look for it before. It's checked, but when I create a brand new stack from scratch that same box is already checked automatically without doing anything else.

Is there maybe a dependency thing where the standalone builder didn't actually include the answer dialog until something in the normal stack called for it?

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

Re: using script-only stack in a standalone

Post by jacque » Sat Oct 31, 2015 6:38 pm

If you are letting LC check for inclusions then it may very well have missed the dialog. I never let it do that, I always select them manually. The default dialogs are only selected under manual inclusions.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”