David -

I have a script called "semaphore" which I use to flag a long-running
process to stop or continue depending on a value in a flag file.  I've put
it on the J wiki at http://www.jsoftware.com/jwiki/DevonMcCormick/semaphore.

The code will need to be customized for your own use but it shouldn't be too
hard; there are a couple of notes on the page to point out a few items to
help you do this.  The major problem is that it is probably more elaborate
than you need.  For instance, I do a lot of work to allow the name of the
flag file to be entered in a number of different ways; you could just
hard-code this to a known name (in function "setFlagFileName").

Feel free to contact me if you would like some help getting this to work.

Devon

On 1/15/08, bill lam <[EMAIL PROTECTED]> wrote:
>
> I think that this is not possible for that running J instance alone. The
> reason
> is J is single thread so that while running the looping code, it can not
> process
> gui messages. Or you may test for a certain file periodically. If that
> file is
> deleted, then exit the loop.
>
> David Porter wrote:
> > I have a loop that processes around a hundred files.  Once started, it
> > must continue or, you must stop it using one of several ugly methods
> > from the operating system.
> >
> > I put in the break. control word that looks at a variable  to enable a
> > way to break out of the loop.  I thought setting that variable with a
> > button on the form would be a good idea, but all I get when I try this
> > while the loop is running is the Windows "boink" .  Is there a good, or
> > any, way to set this variable while the loop is running?
> >
> > Dave Porter
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to