Question about IsCancelled
Hi,
Has anyone used the TaskHandle.EnableSytemCancel attribute
with any success? When should this actually used? I want
to prevent the FORTE runtime from canceling me during
critical sections of my code.
Basically, I'm trying to make sure that my database and
updates I'm doing performing on regular UNIX files are kept
in sync.
Does anyone have any sample code that uses this attribute?
A second question is about the debugger? Is there any
indication, such as an exception or an event, to the
running TOOL code when the user presses the Cancel Task
menu item? I want to do some cleanup before exiting.
-rick
[703 byte] By [
] at [2007-11-25 5:01:19]

I have used the EnableSystemCancel attribute in the case where I am
interfacing to an external C DLL and I need to leave the DLL in a known
state before I clean some stuff up when the task terminates. In my case,
the particular task is a queue service thread, so it's pretty easy to code
this with a while loop.
while not task.isCancelled do
// task body is here
end while;
// task cleanup is here
As for your second question, I believe choosing the Cancel Task option from
the debugger is the same as calling MyTaskDesc.SetCancel() in TOOL code.
The on-line help for CancelException has a good example of how to trap and
handle this.
Kevin Klein
Millennium Partners, Inc.
An association of men who will not quarrel with one another is a thing
which has never yet existed, from the greatest confederacy of nations
down to a town meeting or a vestry.
-- Thomas Jefferson
--Original Message--
From: Kimball, Richard <Richard.Kimball@LibertyMutual.com>
To: 'Forte Mailing List' <kamranamin@yahoo.com>
Date: Monday, December 15, 1997 5:41 PM
Subject: Question about IsCancelled
>Hi,
>
>Has anyone used the TaskHandle.EnableSytemCancel attribute
>with any success? When should this actually used? I want
>to prevent the FORTE runtime from canceling me during
>critical sections of my code.
>
>Basically, I'm trying to make sure that my database and
>updates I'm doing performing on regular UNIX files are kept
>in sync.
>
>Does anyone have any sample code that uses this attribute?
>
>A second question is about the debugger? Is there any
>indication, such as an exception or an event, to the
>running TOOL code when the user presses the Cancel Task
>menu item? I want to do some cleanup before exiting.
>
>-rick
>
at 2007-6-29 9:20:44 >
