MathGroup Archive 2005

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

Search the Archive

Controlling Print[].

  • To: mathgroup at
  • Subject: [mg54018] Controlling Print[].
  • From: Josef Karthauser <joe at>
  • Date: Mon, 7 Feb 2005 03:13:22 -0500 (EST)
  • Sender: owner-wri-mathgroup at

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.

Josef Karthauser (joe at
FreeBSD (cvs meister, admin and hacker)
Physics Particle Theory (student)
================ An eclectic mix of fact and theory. =================

  • Prev by Date: Problem using Evaluate[] inside a Plot command. 5.1
  • Next by Date: Re: Re: Re: Re: New Web Site for Mathematica Users using WikiMedia
  • Previous by thread: Re: Problem using Evaluate[] inside a Plot command. 5.1
  • Next by thread: Re: Controlling Print[].