Page 1 of 1

How to make a custom code library-solved

Posted: Thu Jul 18, 2013 11:09 pm
by waprothero
I have a project that is going to get large. I want to have library stacks where I can put my code for general use by my project. How do I set up a stack that sits in the message path of all of my project stacks where I don't have to use "send" to invoke every handler that I want to call? A substack won't sit in the message path of other substacks, so that doesn't fit my need. I see Library stacks in other project, but can't find the recipe to attach them.

I've scoured the docs, probably missed it, but can't find the answer to what I think should be a very simple question.

Re: How to make a custom code library

Posted: Thu Jul 18, 2013 11:20 pm
by FourthWorld
See "start using" in the Dictionary.

Re: How to make a custom code library

Posted: Fri Jul 19, 2013 12:14 am
by waprothero
Richard: Problem solved.
I was using the message box to invoke the handler. It works when I invoke it on the card that holds the app.

Re: How to make a custom code library

Posted: Fri Jul 19, 2013 10:07 am
by jmburnod
Hi waprothero,
I'am not sure what you mean about library.
You can use a stack to store handlers which you often need.
start using stack "MyLibrary" and all handlers of this stack will be available

Best
Jean-Marc

Re: How to make a custom code library

Posted: Fri Jul 19, 2013 5:03 pm
by waprothero
I just had a session with this, getting it to work. The problem I was having was when I tried to load a stack using the "open" command, I didn't realize that it required that I put the .livecode extension on the stack name. It would be nice if the docs had an example that showed that it required the actual full filename, path, and extension of the stack.

I got it working, finally.