Controlling Print[].
- To: mathgroup at smc.vnet.net
- Subject: [mg54018] Controlling Print[].
- From: Josef Karthauser <joe at tao.org.uk>
- Date: Mon, 7 Feb 2005 03:13:22 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
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. =================