Page 1 of 1

Using substacks as libraries

Posted: Thu Mar 31, 2016 4:05 am
by tpflueger
I've been struggling with trying to pull other open source code such as fastjson but keep running into issues calling the handlers.

I created a substack "fastjson" and put the code as directed. Within the stack script within preOpenStack, I specified start using stack "fastjson" but whenever I try to call the functions from cards within the main stack I get issues.

I've looked and seen multiple examples but hoping someone could show me an example or if there is a better way of creating libraries to include for other stacks/cards.

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 4:11 am
by FourthWorld
What specific issues do you get?

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 4:12 am
by tpflueger
I use the stack within the card script, and then within a button click I call jsonToArray.

button "Button": execution error at line 2 (Handler: can't find handler) near "jsonToArray", char 1

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 5:21 am
by FourthWorld
Run this in the Message Box and see if the stack in there (and spelled as expected):

Code: Select all

put the stacksInUse

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 5:38 am
by tpflueger
Trying stacksInUse is empty, but if I do libraries it shows the one I want.

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 5:52 am
by FourthWorld
That's weirder than I have words for. The stacksInUse produces a list of active libraries.

Well, at least in this dimension.

Where are you getting that library list?

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 6:22 am
by tpflueger
I'm sorry about that, I redid what you said and it worked this time because I capitalized it correctly. It also finally started working but not entirely sure what I did this time to get it to work...

Re: Using substacks as libraries

Posted: Thu Mar 31, 2016 4:23 pm
by FourthWorld
tpflueger wrote:not entirely sure what I did this time to get it to work...
That's the magic of programming. :)

Image