Front and Back Scripts

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Front and Back Scripts

Post by SirWobbyTheFirst » Mon Dec 07, 2009 12:13 pm

I have been experimenting with the front and back scripts for a while and the curiosity monster has reared his head and so I started wondering when you insert a script into the front or back scripts or start using a stack is there an order in which a script is received for example.

Say I insert the script of my first stack into the front script and then insert the script of my second stack into the front script, does the second stack receive a message first or vice versa and is this order applied to the back scripts and stacks in use.

PS. Curiosity killed the cat and its probably gonna get me too. :D And the biggest thank you to everyone who has helped me with my other queries in last few months.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10057
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Front and Back Scripts

Post by FourthWorld » Mon Dec 07, 2009 4:10 pm

The order in which handlers with the same name are triggered is indeed dependent on the order in which frontScripts, backScripts, and libraries are inserted into the message path.

Details on this are available in the Dictionary, and you may find this article helpful:

Extending the Runtime Revolution Message Path
An introduction to using Libraries, FrontScripts, BackScripts and Behaviors
in Runtime Revolution's RevTalk 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

SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 246
Joined: Tue Jun 30, 2009 11:15 pm

Re: Front and Back Scripts

Post by SirWobbyTheFirst » Mon Dec 07, 2009 6:04 pm

So in essence, the example I gave, where the two stacks which where both inserted into the front scripts, the one to be inserted second would have received the message first is true.

I thought this would have been the case. Cos if i query the backscripts function the result shows the order in which the scripts where inserted. Well thanks alot FourthWorld for quenching my first for knowledge. :D

Post Reply