Can't Close Splash Stack on Stand Alone

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: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
physicsclassroom
Posts: 47
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Can't Close Splash Stack on Stand Alone

Post by physicsclassroom » Sun Aug 12, 2018 7:16 pm

I'm finishing a standalone application that has several stacks in it. There is one final bug in the program. Th bug does not surface when I test in the IDE but when I test both the Windows and Mac builds, the bug surfaces. I am trying to close the splash stack (opening stack) when I navigate to other stacks. I'm using the commands:

Code: Select all

set the destroyStack of stack (appLocn & "teacherStart.livecode") to true
close stack (appLocn & "teacherStart.livecode")
where appLocn is set to specialFolderPath("Resources") & "/". All other commands referencing files at appLocn work so that doesn't seem to the the problem. In both the Windows and Mac, builds these two lines issue an error and the teacherStart stack remains open. I've also tried to use

Code: Select all

set the visible of stack (appLocn & "teacherStart.livecode") to false
but this results in an error as well and the stack remains visible. The above two lines seem like such a simple set of commands that work everywhere I use them but not when I use them with the splash stack.

What am I missing?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6239
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by FourthWorld » Sun Aug 12, 2018 7:45 pm

What's in appLocn?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

physicsclassroom
Posts: 47
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by physicsclassroom » Sun Aug 12, 2018 8:03 pm

It is a global variable that is set to the location of the build. For Mac it has been set to specialFolderPath("Resources") & "/".

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2792
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by richmond62 » Sun Aug 12, 2018 8:09 pm

Let's start all over again . . .

IFF I were to make something with a splash stack I'd make sure the splash stack were a substack of my mainStack . . . let's call our splash stack "SPLASH" (for want of any spontaneous, mad bursts of original static).

If my main stack were called "MAINST" (Yes, well quite, I could repeat 'that' again), I'd probably have something of this sort in its stackScript of "MAINST":

Code: Select all

on preOpenStack
set the vis of stack "MAINST" to false
set the lockScreen to false
open stack SPLASH"
set the loc of stack "SPLASH" to the screenLoc
wait 10 ticks
set the lockScreen to true
end preOpenStack
and I'd have something like this in the stackScript of the substack "SPLASH":

Code: Select all

on openStack
wait 30 secs
set the vis of stack "MAINST" to true
set the vis of stack "SPLASH" to false
end openStack
Now, this may be utter rubbish as I made it up just now without testing anything fuelled by 3 glasses of
best, dry Bulgarian white wine.

Live dangerously . . . try it!

The splash stack is NOT closed, it is just HIDDEN. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2792
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by richmond62 » Sun Aug 12, 2018 8:38 pm

Splosh.jpg
-
MAINST.livecode.zip
Here's the stack.
(100.04 KiB) Downloaded 12 times
-
Wow: for almost the first time in my life a stack worked without lots of fiddling around.

I changed the wait period to 10 seconds as 30 was too long.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6239
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by FourthWorld » Sun Aug 12, 2018 9:15 pm

physicsclassroom wrote:
Sun Aug 12, 2018 8:03 pm
It is a global variable that is set to the location of the build. For Mac it has been set to specialFolderPath("Resources") & "/".
Is that where the stack is?

Try adding:

Code: Select all

put (appLocn & "teacherStart.livecode") into tStackFile
answer "Exists?: "& there is a stack tStackFile &cr& tStackFile
That'll at least rule out path issues, the most common cause of inaccessible files (the second leading cause is file permissions).
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

physicsclassroom
Posts: 47
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by physicsclassroom » Sun Aug 12, 2018 9:35 pm

The result was True in the IDE and false in the stand alone. So it's a path problem.

In my preOpenStack handler, I have ...

Code: Select all

put specialFolderPath("Resources") & "/" into appLocn
and then I reference all files in my stand alone with

Code: Select all

someCommand (appLocn & "nameOfStack.livecode")
In the stand-alone, there is no main stack at this location but there is for all the other stacks in the build.

Puzzled.

physicsclassroom
Posts: 47
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by physicsclassroom » Sun Aug 12, 2018 10:23 pm

My main stack has the file name "teachStart.livecode". I tried to locate it in the stand-alone with

Code: Select all

specialFolderPath("Resources") & "/" & "teachStart.livecode"
and as

Code: Select all

specialFolderPath("Engine") & "/" & "teachStart.livecode"
No luck with either. How can I located the main stack in order to close it or make it invisible?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6239
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by FourthWorld » Sun Aug 12, 2018 10:46 pm

Is this the mainstack of the standalone?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

physicsclassroom
Posts: 47
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by physicsclassroom » Sun Aug 12, 2018 11:05 pm

yes it is.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6239
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by FourthWorld » Sun Aug 12, 2018 11:35 pm

Then we have a problem, and an opportunity:

The problem is that document file extensions like ".livecode" are just that, to identify documents. When a LiveCode stack file is made into a standalone, the document extension is removed, thus making hard-wired paths that rely on it from when it was a document file invalid.

The solution is easy: every stack in memory can be addressed by its short name. Just use that. Skip the file reference altogether.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

physicsclassroom
Posts: 47
Joined: Sun Jun 30, 2013 1:43 am
Location: Illinois
Contact:

Re: Can't Close Splash Stack on Stand Alone

Post by physicsclassroom » Mon Aug 13, 2018 1:17 am

Problem solved. The stack is now closing in the stand alone.

Thanks so much for your patience and help.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”