[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #61926] Coding infinite loops in Octave
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #61926] Coding infinite loops in Octave |
Date: |
Wed, 26 Jan 2022 11:54:37 -0500 (EST) |
Follow-up Comment #2, bug #61926 (project octave):
I agree that this is a strange way to loop, but it should work as a way to
execute a script in a completely fresh Octave session each time. It works for
me on a Debian system.
The OP tagged this as a problem with Windows. Is fun.m in Octave's loadpath?
Is it possible that the Octave's startup directory has been set to some
location other than where fun.m is located and that fun.m is not found?
However, in the original, the system command waits for the child to exit
before it returns. So you'll end up accumulating Octave processes until you
run out of memory or the ability to execute a new process. The following
works for me to avoid that problem. I added the call to "pause" so that I'd
have a chance to kill the current process and terminate the loop.
## infloop.m
system ("echo 'pause (5); infloop; exit' | octave", false, "async");
BTW, the savannah bug tracker doesn't use ``` to indicate verbatim markup.
See the notes about markup tags here:
https://savannah.gnu.org/bugs/?group=octave&func=additem
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?61926>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/