Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Can't abort a loop with Print inside (V6)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83108] Re: Can't abort a loop with Print inside (V6)
  • From: Yaroslav Bulatov <yaroslavvb at gmail.com>
  • Date: Sun, 11 Nov 2007 02:58:44 -0500 (EST)
  • References: <fh3r7m$v6$1@smc.vnet.net>

I'm running Mathematica 6 on Windows XP, and I've ran into the same
problem as the OP. An evaluation which produces an unbounded number of
Print messages will essentially freeze the front-end. I usually
terminate Mathematica through Task Manager when this happens.

Yaroslav

On Nov 10, 12:47 am, Bill Rowe <readnews... at sbcglobal.net> wrote:
> On 11/9/07 at 5:15 AM, frank1... at gmail.com (Frank Hu) wrote:
>
> >It seems in Version 6 one can't abort  a loop if there's a Print
> >statement inside.  Try the following code
> >For[i = 1, i < 1000, ++i, Print[i]]
> >No matter doing it from the menu or with the keyboard shortcut, the
> >abort action will be ignored.  Under 5.2, the code stops right away
> >when I hit Cmd-.
> >Sometime, trying to abort would even freeze the whole program,
> >causing lost sessions.  I'm running 6.0.1.0 on Mac OS X
> >10.4.10. Any suggestions of what's going on?  Is this a bug or
> >a new feature?
>
> It would be better described as a feature than a bug. But the
> "feature" is really nothing more than improved performance of
> version 6 compared to previous versions rather than an intent to
> prevent stopping a loop using Cmd-.
>
> For any software (assuming good performance) it will be always
> possible to write a loop that runs so fast that it simply cannot
> be halted using the key sequence. This is a result of only
> having a simple Print statement in the loop rather than having a
> more complex loop.
>
> For example, the loop
>
> Do[Pause[1];Print[n],{n,100}]
>
> can easily be halted with the Cmd-. key shortcut.
>
> OTOH,
>
> Do[Print[n],{n,100}]
>
> cannot be halted in the same manner.
> --
> To reply via email subtract one hundred and four




  • Prev by Date: Re: Curvature for a circle
  • Next by Date: Re: Mathematica 6.0.0 crashes on OSX 10.4.10
  • Previous by thread: Re: Re: Re: Can't abort a loop with Print inside (V6)
  • Next by thread: Re: Can't abort a loop with Print inside (V6)