Empty cards created for script-only stacks - why and is it a problem?

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

Post Reply
standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Empty cards created for script-only stacks - why and is it a problem?

Post by standgale » Fri Jan 28, 2022 3:18 am

A new year, same problems.
I'm still having issues building my projects as standalones if they incorporate script-only stacks. I thought it worked but it only does it sometimes.
So I was wondering if this had anything to do with it.
If I look at the stacks in the Project Browser, they all have cards associated with them. If I delete the cards from the script-only stacks, they reappear when I try to build the stand alone. Livecode also opens these empty cards its just created when I do the build.
I guess Livecode thinks that stacks must have at least one card. But these stacks are scripts being used as behaviours for other cards.

Is this card creation a problem? Is there a way to get rid of them?

project browser.PNG

Since when I mention the project browser people say "don't use the project browser" then I thought I'd say that I also looked in revApplicationOverview and revNavigator and the empty cards also appear there, but reappear when deleted or cannot be deleted.

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

Re: Empty cards created for script-only stacks - why and is it a problem?

Post by FourthWorld » Fri Jan 28, 2022 5:59 am

When loaded, a stack always has at least one card.

With script-only stacks, neither the card nor anything you may put on it is saved; as the name implies, only the stack script is saved.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Empty cards created for script-only stacks - why and is it a problem?

Post by jacque » Fri Jan 28, 2022 10:02 pm

When you create a script-only stack, it is saved to disk as a text file. LC can't run text files so when the script loads, LC creates a temporary, blank stack with its one required card and places the script text into the stack script of the temporary stack. When you stop using the script-only stack, the blank temporary stack is deleted and only its stack script is saved to disk as a text file.

So what you see is normal behavior, unrelated to your build issue.

If your standalone doesn't work as expected because the script-only stack isn't working, it usually means you haven't included it in the stackfiles section in the mainstack's property inspector. LC uses the stackfiles to locate stacks whose scripts refer to them only by short names. The stackfiles provides linkage between the short name and the path to the actual stack. Note that if you change the name of the behavior or its object, all links will break and you'll have to update all references.

Also be sure to add the script-only stack to the Copy Files pane in standalone settings.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

standgale
Posts: 26
Joined: Fri May 07, 2021 4:12 am

Re: Empty cards created for script-only stacks - why and is it a problem?

Post by standgale » Fri Feb 04, 2022 1:58 am

Thanks for the explanations.
Good to know what's going on and glad I can just ignore them.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”