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 »

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 »

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 »

Thanks Jan!
Walt Brown
Omnis traductor traditor
Post Reply