eroticgugl.blogg.se

Library stacks
Library stacks












library stacks

(See illustration at right.) When calling a library stack, remember that all of the standard rules for referring to a file outside of the current stackfile apply thus, myLibrary.livecode would have to be in the defaultFolder, or you would have to provide an absolute file path to its location on the drive. This places the handlers in the library's stack script into the message path after the current stack. Making a stack into a library is easy with one of the following synonymous commands: start using stack "myLibrary.livecode" This stack is then associated with every project in which you want to have access to the common handlers it contains. A library stack is really just a normal stack, but instead of having lots of different cards with buttons and fields and such, it simply has frequently-used handlers in its stack script. On the other hand, if you had wisely looked for a way to efficiently reuse your code, you could have written it just once and saved it in a library stack that you incorporated into all of your projects. If you had ignored your hunch and copied your function into all of your stacks, you would have to go back and manually modify each stack in which you use this function. Months later, you discover an way to make your function better and faster. Why? Let's say you come up with a great new function for proportionally resizing objects that you begin incorporating into all of your stacks. Now, you could just copy and paste message and function handlers from one stack to another, but something tells you that would be a bad idea.

Library stacks code#

That means you may often want to reuse code in different projects. Using Code Libraries in LiveCode What is a Library and Why Should I Care?Īs a programmer you will often find yourself solving similar problems in many different stacks.

library stacks library stacks

Office of Digital Humanities Back BYU LiveCode Lessons Gateway DigHT 310














Library stacks