Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Controlling Print[].

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54024] Re: Controlling Print[].
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 8 Feb 2005 05:30:59 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <cu78se$m8e$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

you mean

k = 0;
Do[
k++;
If[Mod[k, 128] == 0,
NotebookWrite[SelectedNotebook[], ToString[i] <> " "]],
{i, 1024}]

??

Regards

  Jens

"Josef Karthauser" <joe at tao.org.uk> schrieb im Newsbeitrag 
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: Summary: Which[] as Textbook Input, Plot[] Questions
  • Next by Date: Finally, a simple example of a mystery
  • Previous by thread: Re: Controlling Print[].
  • Next by thread: Re: Controlling Print[].