Hi to all,
What about SharedScript in LC ? I've seen an old post from 2010 on the forum, but 4 years later, is there a way to assign one script to multi btt or fld, or any object within the project ?
Thanks in advance, Jean-Paul.
SharedScript [Solved]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
SharedScript [Solved]
Last edited by atout66 on Fri May 16, 2014 6:23 pm, edited 1 time in total.
Discovering LiveCode Community 6.5.2.
Re: SharedScript
look in the documentation at the "function" and "on" control structures. I think that is what you are looking for.
Re: SharedScript
Hi Jean-Paul,
every handler and function that is in the card/stack/library stack script IS in already "shared"!
This is a question of cleverly using the "message path". A good read about this topic:
http://www.fourthworld.com/embassy/arti ... _path.html
And then there are "behaviors", which you can apply to one or more objects.
Or do you mean something else?
Best
Klaus
every handler and function that is in the card/stack/library stack script IS in already "shared"!
This is a question of cleverly using the "message path". A good read about this topic:
http://www.fourthworld.com/embassy/arti ... _path.html
And then there are "behaviors", which you can apply to one or more objects.
Or do you mean something else?
Best
Klaus
Re: SharedScript
Thanks to both of you for your help.
From the link provided by Klaus, I realize that in fact, what I was used to call a <sharedScript> in TBK is called <Behaviors> in LC.
However, the logical is the same; so great
Kind regards, Jean-Paul.
From the link provided by Klaus, I realize that in fact, what I was used to call a <sharedScript> in TBK is called <Behaviors> in LC.
However, the logical is the same; so great

Kind regards, Jean-Paul.
Discovering LiveCode Community 6.5.2.
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: SharedScript [Solved]
There are several ways to share code among objects:
- Any mainstack script is accessible by any object in the stack file
- Backscripts and libraries are available to all stacks
- FrontScripts can be used to global preprocess messages
- Behaviors can be used to provide a single script across any number of specific objects
For an overview of how these fit together:
Extending the LiveCode Message Path
An introduction to using Libraries, FrontScripts, BackScripts and Behaviors
in RunRev's LiveCode Programming Language
http://www.fourthworld.com/embassy/arti ... _path.html
- Any mainstack script is accessible by any object in the stack file
- Backscripts and libraries are available to all stacks
- FrontScripts can be used to global preprocess messages
- Behaviors can be used to provide a single script across any number of specific objects
For an overview of how these fit together:
Extending the LiveCode Message Path
An introduction to using Libraries, FrontScripts, BackScripts and Behaviors
in RunRev's LiveCode Programming Language
http://www.fourthworld.com/embassy/arti ... _path.html
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn