Cannot add script only stack in Standalone Applications Settings

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 419
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Cannot add script only stack in Standalone Applications Settings

Post by kaveh1000 » Sat Jan 11, 2020 12:36 pm

Using Indy 9.5.1 on Mac Catalina.

I have a main stack that uses several script only stacks. One of those stacks is set as the behaviour of the main stack. The others are used as needed. When creating a standalone, I want to add all those stacks to the Stacks area of Standalone Applications Settings. I can add all but the one stack that is used as the behaviour. The dialog box opens and it allows me to choose the behaviour stack but it is not then visible in the list of selected stacks.

Idea pls?

Kaveh
Kaveh

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by dunbarx » Mon Jan 13, 2020 6:23 pm

Hi.

Check out this discussion:
viewtopic.php?t=32430

Craig

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 419
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Cannot add script only stack in Standalone Applications Settings

Post by kaveh1000 » Mon Jan 13, 2020 6:30 pm

Thanks Craig. That is a useful discussion. I solved my problem by adding the stacks in the "Add files" pane rather than the Stacks pane. I think as the stack was already set as the behaviour, it cannot be added again as a Stack.
Kaveh

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by dunbarx » Mon Jan 13, 2020 7:01 pm

I think as the stack was already set as the behaviour, it cannot be added again as a Stack.
Hmmm.

This seems unlikely, or at least odd. Anyone know if it is true? And if so, why?

But in any case, were you able to include all the non-behavior stacks in the stack pane, and only this one in the file pane? Or did all go into the file pane?
That might answer the question I had above.

Craig

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 419
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Cannot add script only stack in Standalone Applications Settings

Post by kaveh1000 » Mon Jan 13, 2020 8:10 pm

All now in the files pane. And it is working ok. It is something I would like to understand more. If I have a script only stack, should it go in files or stacks. There was a comment by Jacque in the thread that you pointed to that it is files.
Kaveh

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by jacque » Mon Jan 13, 2020 11:14 pm

Script-only files are text files, so they go in the "Copy Files" pane. They aren't binary, so the Stacks pane won't accept them.

When an app opens a script-only stack file, it creates a temporary stack (in RAM only) and puts the text of the file into the temporary stack script. From that point on, the stack behaves just like any other stack and you can treat it the same way. When the app closes, the temporary stack is destroyed. That's why script-ony stacks can't save properties or objects or anything else. But while the temporary stack is in use, you can assign properties, create objects, etc. and use them during the session as long as you're aware that when the session ends none of those changes will be saved. (An exception is when you're working in the IDE, which does save changes to the stack script, but nothing else.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 419
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Cannot add script only stack in Standalone Applications Settings

Post by kaveh1000 » Mon Jan 13, 2020 11:33 pm

Thank you Jacqueline for the explanation. That makes sense. But what has been confusing me is that the Stacks pane in Standalone settings does accept all these script. Whether or not they are used or not I don't know but they show up in the Stacks area. The only exception is the script only stack that I have already set as the behaviour for the main stack. LiveCode still allows me to specify it through the dialog box but it does not show up in the list.

Anyway, all seems to be working by using the File area. :-)
Kaveh

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by jacque » Tue Jan 14, 2020 12:06 am

Interesting. I've always assumed the files went into the Copy Files pane and I don't think I've tried adding them to the Stacks pane. Which is a long way of saying "I don't know why that happens."
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by dunbarx » Tue Jan 14, 2020 3:49 am

If I understand correctly, and I rarely do, several script-only stacks were accepted into the stacks pane, but the behavior one was not. All were eventually accepted into the files pane.

But is this in fact true? I am only interested academically, that assigning a behavior would change that.

Craig

kaveh1000
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 419
Joined: Sun Dec 18, 2011 7:23 pm
Location: London
Contact:

Re: Cannot add script only stack in Standalone Applications Settings

Post by kaveh1000 » Tue Jan 14, 2020 9:38 am

Hi Craig

Although the problem seems solved, good to get an understanding of what is going on as you say. Here is my code in my main stack:

Code: Select all

local sLibraryPath

on preOpenStack
   put specialfolderpath("resources") & "/script/MainFile_behaviour.livecodescript" \
         into tBehaviour
   set the behavior of stack "MainFile" to the long ID of stack tBehaviour
   start using stack tBehaviour
   --
   put specialFolderPath("resources") & "/script/" into sLibraryPath
   use_library "Lib_1" -- script only stacks
   use_library "Lib_2"
   ...
   use_library "Lib_n"
end preOpenStack

on use_library pStack
   put pStack & ".livecodescript" into tStackName
   put sLibraryPath & tStackName into tPath
   open stack tPath
   start using stack tPath
end use_library
So I set the behaviour first then call in all other script only stack needed.

When I add the script only stacks to the "stacks" area of Standalone Application Settings, I can add all stacks, except for the behaviour stack. For some reason it is not seeing that even though it is a simple script only stack. So it seems that the fact that the file has been set as the behaviour of the main stack is treated differently and cannot be added. Strange.
Kaveh

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by dunbarx » Tue Jan 14, 2020 5:37 pm

Since all the Standalone Settings are done by hand, I cannot see how any script can be pertinent.

I also cannot see how changing a property of a script-only stack can change its ability to live in the stack pane, regardless of whether that pane is the proper pane.

Anyone have any ideas?

Craig

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by FourthWorld » Tue Jan 14, 2020 5:49 pm

dunbarx wrote:
Tue Jan 14, 2020 5:37 pm
...changing a property of a script-only stack...
A script-only stack has only a script, no properties.
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/

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by jacque » Tue Jan 14, 2020 6:41 pm

Is there a reason to assign the script as a behavior and then also start using it? Typically behaviors are private to specific controls, while stacks in use are like backscripts that are in the message path for everything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by dunbarx » Tue Jan 14, 2020 7:24 pm

A script-only stack has only a script, no properties.
True. I misrepresented the word "property". It is that the behavior property was set that, er, sets this particular stack apart. And that is what baffles me; how do it know? Is it so?

Craig

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

Re: Cannot add script only stack in Standalone Applications Settings

Post by FourthWorld » Tue Jan 14, 2020 7:49 pm

Is the SoS being used as a behavior, or using something else as a behavior of its own?

I do believe an exception was added to the SoS definition to allow it to have its own behavior, declared in the second line of its text.

But either way, I'm not understanding the question.
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/

Post Reply

Return to “Talking LiveCode”