MathGroup Archive 2005

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

Search the Archive

Re: Controlling Print[].

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54030] Re: Controlling Print[].
  • From: "Carl K. Woll" <carlw at u.washington.edu>
  • Date: Tue, 8 Feb 2005 05:31:07 -0500 (EST)
  • Organization: University of Washington
  • References: <cu78se$m8e$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Josef,

I like Theodore Gray's solution:

Showstatus[status_] :=
  LinkWrite[$ParentLink,
    SetNotebookStatusLine[FrontEnd`EvaluationNotebook[],
ToString[status]]]

Just use ShowStatus instead of Print, and whatever you print will show up in
the status line. Note that the status line is present in the default style
sheet. If you happen to use a style sheet which doesn't have a status line,
you can fix this by going to the option inspector, and setting the
WindowElements option to include "StatusArea".

Carl Woll


"Josef Karthauser" <joe at tao.org.uk> wrote in message 
news:cu78se$m8e$1 at smc.vnet.net...
>
> Dear anyone know a way of controlling Print[]?  I've got a large loop
> that I want to keep tabs on, and see how quickly it is running.  Within
> one of the inner loops I'm doing something like 'a // Print' where 'a'
> is some kind of location indicator.  This is fine in principle, but in
> practice the inner loop runs lots of times and so I get a single output
> box per time (several pages).  What I would like to do is have them
> printed one after another on the same line, i.e
>
>    for(i = 0; i < 1000; i++) {
> printf("%d ", i);
>    }
>
> instead of
>
>    for(i = 0; i < 1000; i++) {
> printf("%d\n ", i);
>    }
>
> Is this kind of thing possible?  I can imagine constructing a string in
> the loop and then printing that, but that wouldn't give the desired
> affect because it would effectively behave like buffered output; what I
> want is unbuffered, i.e. print the variable to the current output box,
> but don't finish it yet as the next output also want to go here.
>
> Joe
> --
> Josef Karthauser (joe at tao.org.uk)        http://www.josef-k.net/
> FreeBSD (cvs meister, admin and hacker)     http://www.uk.FreeBSD.org/
> Physics Particle Theory (student)   http://www.pact.cpes.sussex.ac.uk/
> ================ An eclectic mix of fact and theory. ================= 



  • Prev by Date: Re: Re: Re: Re: Re: New Web Site for Mathematica Users using WikiMedia
  • Next by Date: Re: Controlling Print[].
  • Previous by thread: Re: Controlling Print[].
  • Next by thread: Re: Controlling Print[].