Open stack error message

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

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 110
Joined: Fri Mar 09, 2007 9:47 pm

Open stack error message

Post by jsburnett » Thu Oct 06, 2016 8:36 pm

Hi,
I have a simple problem.
I am trying to open a substack thru a button as follows:

on mouseUp

put the selectedText of me into openThisStack
go to openThisStack

end mouseUp

When I initiate the mouseUp handler the stack does 'open' but I get the following error:

executing at 3:31:08 PM

Type Handler: error in statement
Object stack list
Line go to substack openThisStack
Hint mouseUp

This is not a standalone stack, FYI.

I've tried changing "go to openThisStack" with "open stack openThisStack" and same result.

Any ideas on how to correct?

Thanks in advance.

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

Re: Open stack error message

Post by dunbarx » Thu Oct 06, 2016 9:31 pm

Hi.

Has to be a little glitch in the matrix.

What happens if you explicitly go to the stack listed in the text. That is, write it out by hand (do not copy from whatever source you extract that pathname from) and execute. If it goes, there is something in the stored text. If it gives the same error, there is something in the pathName.

Write back with what you discover.

Craig Newman

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 110
Joined: Fri Mar 09, 2007 9:47 pm

Re: Open stack error message

Post by jsburnett » Thu Oct 06, 2016 9:48 pm

Thanks Craig,
I tried as you suggested
open stack "stack name"
and same result.

The handler is actually in a list field.
I checked the var and it is correct. The correct text is in the var (checked text and num of chars to be sure it was correct).

The correct stack does open with the error, so that is odd. But I am only a rookie.

I'll just keep plugging away at the rest of the stack.

Thanks again.

John

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

Re: Open stack error message

Post by dunbarx » Thu Oct 06, 2016 10:58 pm

Can you (pseudo):

Code: Select all

get the pathName of the stack of interest, using the "Answer File" command.
 go stack it.
??

Craig

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 110
Joined: Fri Mar 09, 2007 9:47 pm

Re: Open stack error message

Post by jsburnett » Thu Oct 06, 2016 11:14 pm

Craig,
Well, since they are substacks I can not navigate to them with the 'answer file'
Thanks.
John

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Open stack error message

Post by [-hh] » Fri Oct 07, 2016 3:32 am

If you do it from a button then the selectedText becomes empty if the button is not a menu button ...
shiftLock happens

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

Re: Open stack error message

Post by jacque » Fri Oct 07, 2016 3:54 pm

The error message indicates that somewhere you have an object named "stack list" that has a handler containing invalid syntax. The incorrect statement is "go substack", which should be just "go stack" (or alternately, "open stack").

It sounds like the list field has a handler that tries to go to the substack and you've created a button that does the same thing. Clicking the list field triggers the error.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 110
Joined: Fri Mar 09, 2007 9:47 pm

Re: Open stack error message

Post by jsburnett » Fri Oct 07, 2016 4:39 pm

So I know, as I reread the messages, I am not very clear.
I have a 'splash stack' - an main stack that opens and then should open a substack:

on openStack
put the substacks of this stack into allsubstacks
put allsubstacks into field "Stack List" -- this puts all the substacks in a list field so I can open them as I develop the substacks by clicking on them in the field.
open stack "Notes" -- this should 'open' the substack 'Notes', and it does, with the error ....
end openStack

interestingly I also get the error when using the message box - although the stack opens.
I check firewall settings too.

thanks for all your replys.

John

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

Re: Open stack error message

Post by dunbarx » Fri Oct 07, 2016 6:19 pm

Jacque's point about the syntax error is important. But in your orignial post, you did not say "go to substack...", though when you presented the error text, it did indeed have that extra word.

That word is not a native word.

But the result of the "substacks" property is just a list of stack names, and that list is loaded into the field. So how did that extra word get into the fray?

Craig

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

Re: Open stack error message

Post by jacque » Fri Oct 07, 2016 10:22 pm

Use LC's "Find and Replace" tool in the Edit menu. Put "go to substack" into the search field and uncheck all the boxes except for "Script". Do a search. It should list where the incorrect syntax is, and if you double-click the error line the script will open so you can correct it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 474
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: Open stack error message

Post by jameshale » Sat Oct 08, 2016 12:47 am

You wrote:
I have a 'splash stack' - an main stack that opens and then should open a substack
I am intrigued as the use of a 'splash stack', as I have understood it, was to enable modification of the other main and supporting stacks in a standalone as only the 'splash stack' becomes part of the executable and thus not modifiable whereas the other stacks just form part of the package.

Having a splash stack that has sub stacks doesn't achieve this as substacks are all part of the same stackfile as the main stack (or spalsh stack,in this context) and would have the same limitations placed upon them as the splash stack in a standalone, namely nothing could be changed in them.

So, can I ask why you are using a "splash stack"?

If it is not for the usual reason I have outlined, which would not use substacks, is it just to have a very different initial screen display before your app opens proper, so different it just couldn't be a card of your main stack'?

James

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 110
Joined: Fri Mar 09, 2007 9:47 pm

Re: Open stack error message

Post by jsburnett » Wed Oct 12, 2016 7:24 pm

So I think the whole issues was that there must be some problem with the firewall since I do not get this error on other comupters.
I did replace the word substack
I am using substacks/splash stack so I can save files in a standalone.

Thanks for the help.
Sorry I was not entirely clear.
John

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

Re: Open stack error message

Post by jacque » Wed Oct 12, 2016 7:54 pm

I think this may be a common misuse of the word "substack". In LC, a substack is part of the same file on disk and will not allow changes to be saved. If a splash stack is saved as the standalone and then opens other mainstacks, those mainstacks can be saved because they are not actually part of the standalone, they are independent stack files.

Some users call any stack that a standalone opens a "substack" but that isn't always correct. If the stack isn't in the same file, it isn't a substack.

However, there is an option in standalone settings that separates substacks from the mainstack when the app is built, causing all existing substacks to be removed from the file and recreated as independent mainstacks. In this case, the stacks are substacks during development but mainstacks in a standalone. That might be happening here.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jsburnett
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 110
Joined: Fri Mar 09, 2007 9:47 pm

Re: Open stack error message

Post by jsburnett » Sat Oct 15, 2016 6:34 pm

Jacque,

Thanks for your reply.

The eye sees only what the mind is ready to see... I think is 'kinda' the quote

I see my mistakes with the term 'substacks' and this is why changing to a 'stand alone' - i get errors!

I am not a professional coder, so i appreciate the education.

Wow. Thanks.

John.

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

Re: Open stack error message

Post by jacque » Sat Oct 15, 2016 8:02 pm

The eye sees only what the mind is ready to see... I think is 'kinda' the quote
I am reminded of somthing Mark Wieder posted once, which I thought was not only very funny but also accurate: "I'll see it when I believe it."

For what it's worth, the "substack" terminology is a very, very common cause of confusion for new LiveCoders. Just about everyone has to figure it out at some point. The idea of having several apparent "files" glued together into a single file on disk is fairly obscure.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”