Page 1 of 1

Cant Create New Card in a Stack by Script

Posted: Sun Aug 27, 2023 6:09 pm
by jsburnett
Hi,
I am having creating by a script a new card.
I am trying to creat a new card in a button script.
The button name is "Add" FYI.

The line I am having trouble with is:
create card tNewCardName in stack "Product Data"

The tNewCardName is the name of the new card to be added to stack "Product Data"

This button, "Add" is on/in a different stack.

The Error I am getting is:
button "Add": execution error at line 17 (Chunk: can't find stack), char 1

Any thoughts?
Thanks in advance.
John Burnett

Re: Cant Create New Card in a Stack by Script

Posted: Sun Aug 27, 2023 9:27 pm
by dunbarx
John.

There is nothing wrong with your handler. Even so, I made two simple test stacks with the pertinent gadgets to execute the single line of code you posted.
But I see you have more going on in your handler, so the problem lies in there somehow. Step through your code and you will find the culprit.

Craig

Re: Cant Create New Card in a Stack by Script

Posted: Mon Aug 28, 2023 1:32 am
by jsburnett
Craig,

Thanks for the reply.
I found the problem.
The name of the stack, when I checked under the property inspector ended with a 'space' 'Product Data '.
That gave the error.
Thank you for your help.
John

Re: Cant Create New Card in a Stack by Script

Posted: Mon Aug 28, 2023 1:50 am
by dunbarx
Ah.

"Invisible" spaces have messed up stuff for me forever. Hard to see, and oftentimes I have simply rewritten certain bits, all the whiie thinking that I never changed a thing, but the problem went away.

Craig