Why Script-only stacks?

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

foosmaster
Posts: 30
Joined: Mon Apr 13, 2020 8:46 am

Re: Stacks scripts only

Post by foosmaster » Tue Apr 14, 2020 12:56 pm

I am having another problem which I think is an outcome of this issue.
this is structure of stucks I have:
1: main stack - empty of any code aside of

Code: Select all

on openStack
   open stack "WsController"
   open stack "GuiController"
   start using "WsController"   
   start using "GuiController"   
end openStack
2: GuiController - script only to handle all Gui related stuff - also access WSController when an API call is needed
3: WSController - script only that handles all API to my server + event using long polling with

Code: Select all

load URL with event


in debug everything works, thanks a lot, when I try to build an EXE I get an error message on the screen:
a Stack with th same name as the one you are trying to load is already open.
before loading C:/dev/x/main.livecode, what do you want to do with the stack Z:/dev/x/main.livecode
my stack code resides on Z: and I am trying to generate the exe on C:

also I am getting loads of stacks I am not using loaded with error message too, like:
a stack "revCursors" is already in memory. The LiveCode UI does not distinguis stacks which have identical names, so editing these stack files while both are in memory could result in data loss
the same goes for "answer dialog"

I've tried what suggested in another thread:

Code: Select all

delete stack revCursors of stack "main"
and

Code: Select all

delete stack "revCursors" of stack "main"
, both failed with
Error description: Chunk: can't find stack

sometimes I get this pop up once, sometimes a lot, I could've build an exe after 1-3 messages, now I get 30 - and I have to kill the live code process

any idea why this happens ?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Stacks scripts only

Post by richmond62 » Tue Apr 14, 2020 2:55 pm

Most unwise calling your main stack "main." 8)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Stacks scripts only

Post by FourthWorld » Tue Apr 14, 2020 3:19 pm

richmond62 wrote:
Tue Apr 14, 2020 2:55 pm
Most unwise calling your main stack "main." 8)
Why? I've done that.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

foosmaster
Posts: 30
Joined: Mon Apr 13, 2020 8:46 am

Re: Stacks scripts only

Post by foosmaster » Tue Apr 14, 2020 4:04 pm

It's actually called whist in file whist.livecode, so replace all 'main' with 'whist'
not that I see any issue that might rise from calling it 'main' but ... this isn't the case - so I have another problem.

foosmaster
Posts: 30
Joined: Mon Apr 13, 2020 8:46 am

Re: Why Script-only stacks?

Post by foosmaster » Tue Apr 14, 2020 4:12 pm

my 2 cents:
I try to pul ALL of my code in a script only stack, this makes git VERY happy, and version trackng super easy, also I can edit it in a 'normal' editor - open LC, and just run it there.

before I did that, every save (a stack of 8MB size) would take 5-10 seconds, that's horrible, I wish there was a way to reload a stack script updated outside LC - right now I restart LC - which is also a pain, so I try to do most of the massive coding outside LC.

foosmaster
Posts: 30
Joined: Mon Apr 13, 2020 8:46 am

Re: Finally facing a script-only stack

Post by foosmaster » Tue Apr 14, 2020 4:20 pm

1. if you do serious development - or used to do that - you want to track development and recover a non working code to a working version, the EASIEST / safest way (IMO) is to checkout that version from your version control
2. saving a stack filled with images and code causes a big change, LC seems to hang a lot with this (I am experiencing anywhere from 5-15 seconds), when saving SOS seems to work much much faster (1-3 seconds).

and of course
3. use your own editor where the most right Enter doesn't close the active tab (arrrggg - why oh why ?), use regular expressions for search / replace
but really ... again IMO - I like the concept of LC - code once, build for every target, not the implementation of it - (it's REALLY slow - both in development AND runtime)

your milage may vary

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Stacks scripts only

Post by richmond62 » Tue Apr 14, 2020 4:45 pm

Screenshot 2020-04-14 at 18.43.35.png
-
Check out which stacks are open and might be interfering with things.
Attachments
Tut tut.livecode.zip
Here's the stack.
(938 Bytes) Downloaded 280 times

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Why Script-only stacks?

Post by Mikey » Tue Apr 14, 2020 4:48 pm

Regarding the reload, see previous. You don't have to quit LC and restart it to get a reload.
Trevor wrote a python script that is included with Levure that you can add to the sublimeText plugins, and a listener/server script that you can add to your project (if you choose to pull the code out of Levure instead of using Levure). Then when you save a file in your project in sublimetext, it notifies LC to auto-reload the SOS you just modified.
-OR- you could wrap your project in Levure.
You don't have to convert your entire project to SOS's to use Levure. Levure is happy to deal with your normal LC stack as it is. In fact, you can convert as much or as little of your LC stack as you choose to SOS's, because Levure is a framework. The first time you add Levure to a project, the first thing you will be asking yourself is "What's all the fuss about?", because it's just a framework.
I am not sure why you would consolidate scripts into a single SOS. You can, I suppose, but I have no idea why you would. You would have to refactor a lot of code, and if anything I think it makes it harder to use version control (especially for projects that are thousands or tens-of-thousands or hundreds-of-thousands of lines, or have many objects).

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Stacks scripts only

Post by FourthWorld » Tue Apr 14, 2020 4:48 pm

Is there really a stack "revCursors" in your stack file? How did it get there?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Stacks scripts only

Post by richmond62 » Tue Apr 14, 2020 4:49 pm

Possibly, just possibly, the problem is that when you come to build your standalone the fact that your
substacks are open causes the problem.

I wonder if, when one builds a standalone from a stack with substacks the standalone builder
does not open the substacks as part of the build process, and as instances of those substacks
are already in the memory they don't conflict with each other?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Finally facing a script-only stack

Post by FourthWorld » Tue Apr 14, 2020 4:52 pm

For #2, I'm assuming you're seeing that on Windows, yes?

If so, this issue with an interaction between LiveCode and the Win10 file I/O routines was recently diagnosed and fixed. You should see much improved save time for stack files in the next release, more or less on par with the zippy saves LC does on Linux and macOS.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Why Script-only stacks?

Post by FourthWorld » Tue Apr 14, 2020 4:53 pm

Why do we have three separate threads all discussing the basic mechanics of getting started with SoS?

Should I merge them?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Finally facing a script-only stack

Post by richmond62 » Tue Apr 14, 2020 4:57 pm

foosmaster wrote:
Tue Apr 14, 2020 4:20 pm
the most right Enter doesn't close the active tab
-
Enter.jpg
-
Funnily enough, my keyboard has only 2 ENTER keys; but as you use the word 'most' you obviously have more.

Mind you, this is because some wag decided to label the RETURN key with ENTER as well as the ENTER key, leading to confusion.
-
keyboard.png
-
Never had that problem with either of my BBC computers. 8)

foosmaster
Posts: 30
Joined: Mon Apr 13, 2020 8:46 am

Re: Stacks scripts only

Post by foosmaster » Tue Apr 14, 2020 5:00 pm

I only have 4 stacks opened - I can't seem to attach images here, any reason ?
is there any other way other than "Poject browser" to see which stacks are currently open ?

this brings be to the first question - I think because my stacks tries to open an already opened stack - it goes crazy on the Exe creation
also why did I get the revCursors stack ?
and also- each other stack seems to have a card - though it's a script only stack - confusing ...

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Stacks scripts only

Post by richmond62 » Tue Apr 14, 2020 5:02 pm

foosmaster wrote:
Tue Apr 14, 2020 5:00 pm
see which stacks are currently open ?
Have a go with that stack I uploaded about 5 minutes ago . . . No; it won't bite. 8)

Post Reply