Re: How to halt a running program without losing data?



While the use of INQUIRE to test for a user signal is more portable,
the means of posting the signal file using "the "create a file with
some specific name" button on the keyboard still is OS-dependent. Can
you expand on this?

The only assumption the application needs to make is that there exists
a means for the user to post a signal when dialog is desired. A single
routine can be created to return TRUE if a signal has been posted. The
routine can be called from anywhere in the app at any time, without the
means of detecting the signal being known outside of the routine. The
routine can use an OS-dependent check of a keypress or a portable
INQUIRE about a signal file. If the latter is used, the means of
posting the file itself is OS-dependent. So it seems that some
OS-dependent piece must be devised anyway. The default to be used when
no means of signalling exists is for the routine to return FALSE
always.

I do concede that using INQUIRE on a signal file allows the developer
to create a portable program that can be compiled for the end user's
OS, but someone along the line to the end user must assume the burden
of implementing the means of posting the signal file. As a developer, I
would much prefer to assume this burden myself and distribute an
executable only, targeted for a particular OS, rather than take the
"batteries not included" approach.

*** Hendrickson wrote:

"A more portable solution is to use an INQUIRE by file name
and periodicially check for a specific file's existence.
When the user wants to interrupt the program, he pushes the
"create a file with some specific name" button on the
keyboard."

.


Quantcast