Differences between cantAbort and allowInterrupts

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Differences between cantAbort and allowInterrupts

Post by WaltBrown » Thu Jun 25, 2009 10:08 pm

What are the differences between "cantAbort" and "allowInterrupts"? They appear in the Dictionary to be complements of each other, except that in their default settings of False would appear to conflict.

Thanks,
Walt
Walt Brown
Omnis traductor traditor

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Fri Jun 26, 2009 6:03 am

The cantAbort property prevents you from interrupting running scripts in a specific stack, whereas the allowInterrupts property is global. Their default values are actually not contradictory: the cantAbort of a stack is false by default, and the allowInterrupts is [true by default - so you can break out of runaway scripts.
Personally, I prefer using allowInterrupts, setting it to false before a transaction and resetting it afterwards. And if I have a long loop, I'll regularly check the interrupt at safe points in the business logic. This way, I'm sure that everything that needs to be done as a block is done as a block.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

WaltBrown
Posts: 466
Joined: Mon May 11, 2009 9:12 pm

Post by WaltBrown » Sat Jun 27, 2009 4:14 am

Thanks Jan!
Walt Brown
Omnis traductor traditor

Post Reply