Strange Error from card to stack

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
reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Strange Error from card to stack

Post by reelstuff » Fri May 03, 2013 4:57 pm

I am getting an error in the script editor, that shows,

Code: Select all

button "save_sub1": execution error at line 13 (Chunk: no such object) near "export_field3", char 20
The script is showing this then it pops up the script editor showing the line, and above info,

I am sending a mouseUp message from the main stack to a substack, I have commands in the substack designed to save the data from the main stack to the sub stack, I think it may have to do with the message path or something like that but not sure what I am doing wrong here.

the main stack sends data to fields in the substack and in the substack there is a button that sends a command to the card, in the substack to combine fields of text into one text field.

It appears to work but it keeps throwing the error on the last line, where a variable is used to combine the text and put it into a field.

Any thoughts on how to manage this without errors would be awesome, )

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5132
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Strange Error from card to stack

Post by Mark » Fri May 03, 2013 7:55 pm

Hi,

Post the offending line.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Strange Error from card to stack

Post by reelstuff » Fri May 03, 2013 8:58 pm

Here is the line,

put snippetVar1 into fld "export_field1"

What I ended up doing was performing the command from the main stack and just referencing the substack.

I suspect that sending a mouseUp message to the substack caused the problem.

just guessing that when the message was passed to the substack there was no way to return the focus to the main stack.

There might be a method of doing that, I would be interested in learning using version 5.5.4

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5132
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Strange Error from card to stack

Post by Mark » Fri May 03, 2013 9:03 pm

Hi,

Was snippetvar1 the name of a field? If so, then you should probably have used the text of snippetvar1 and instead of the (short) name, you had to use the long id.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Strange Error from card to stack

Post by reelstuff » Fri May 03, 2013 9:15 pm

I used the term as a variable to store different text from different fields, placing "cr" between each text line.

I did try the text of the variable just to see if that would make a difference.

I wonder if I have to "start using a substack" but that would not make sense as the message is obviously getting to the substack.

in the main stack there is a script that answers once the text has been saved to the substack, so the message goes from the main stack to the substack and that is when the error starts because there is another command in that string that needs a message to start functioning again, (thats a guess)

So what I did to get it to work was to operate on the text fields, referencing the id of the card of the name of the substack.

It works fine, but I really wanted to be able to run scripts from the substack too, so I can import data to the substack and transfer it to the main stack.

I have not tried that yet it will probably work just fine because there is not a mixup in messaging.

I will have to look it up and see if there is a way to shift the message back from the substack after the substack has finished running.

thanks for your reply.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Strange Error from card to stack

Post by Simon » Fri May 03, 2013 9:48 pm

I think you have it.
That error sounds like it was try to find the field on the same card the put was used.

put snippetVar1 into fld "export_field1" of card "myNextCard" of stack "mySubStack"
or the long id.
Going back up from the substack you should do the same.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

reelstuff
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 254
Joined: Mon Apr 16, 2007 12:06 am
Location: USA
Contact:

Re: Strange Error from card to stack

Post by reelstuff » Fri May 03, 2013 10:18 pm

yes, that is the answer, over thinkers anon, LOL,

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”