Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: newlines, newlines ...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77758] Re: newlines, newlines ...
  • From: David Bailey <dave at Remove_Thisdbailey.co.uk>
  • Date: Sat, 16 Jun 2007 03:26:24 -0400 (EDT)
  • Organization: Customer of PlusNet plc (http://www.plus.net)
  • References: <f4r4nh$ad6$1@smc.vnet.net> <f4ti9u$f4a$1@smc.vnet.net>

Jean-Marc Gulliet wrote:
> alexxx.magni at gmail.com wrote:
>> I am wondering if there is a way, in M, to Print without getting a
>> newline each time.
>> It happens often to me when debugging, to introduce some kind of
>> progress indicator, say:
>>
>> Print[Floor[100*i/max_i], "%"]
>>
>> but I didnt want to clutter the screen so much. Besides, hundreds of
>> other possibilities come to mind when thinking about output without
>> ending newline...
>>
>> As a side note, trying to solve this (minor) problem, I happened to
>> find:
>>
>> ProgressIndicator[Dynamic[x]]
>>
>> something which seemed perfect!
>> Yet, I'm still unable to use it: for some reasons it is not updated
>> <until> the calculation (which requires the progress indicator) is
>> finished. At that point, useless, the bar moves from zero to full (and
>> yes, dynamic updating is enabled)
>>
>> Any hint for either problem is really welcome!
>>
>> Alessandro Magni
> 
> You could use *WriteString* and the standard output stream as in,
> 
> WriteString["stdout", "Here we are: "]
> Do[WriteString["stdout", StringJoin[ToString[n], " .. "]], {n, 10}]
> WriteString["stdout", "The End!"]
> 
> Here we are: 1 .. 2 .. 3 .. 4 .. 5 .. 6 .. 7 .. 8 .. 9 .. 10 .. The End!
> 
> Regards,
> Jean-Marc
> 
That was interesting - I had not realised that you could do that! 
Perhaps you know the answer to a related question. Can you MOVE the 
place where the ordinary output from a command will go - maybe to 
elsewhere in the same notebook, or (more usefully) to another notebook? 
SelectionMove does not achieve this.

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: bad performance of Reduce (5.2)
  • Next by Date: MathLink: letting Mathematica do the hard work
  • Previous by thread: Re: newlines, newlines ...
  • Next by thread: Re: newlines, newlines ...