comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: suppressing carriage return in PRINT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: suppressing carriage return in PRINT [message #30575] Tue, 07 May 2002 18:47 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Kenneth Mankoff <mankoff@snoe.colorado.edu> writes:

> Chris O'Dell <odell@cmb.physics.wisc.edu> writes:
>
>> This should be really easy. How do you print something (to the normal
>> print window in IDL) without a carriage return?
>
> Use the Craig Markwardt routine: STATUSLINE
>
> Craig: Is there any chance you can get this to work in EMACS? Or you
> could give me some pointers how to modify it? I know
> its not vt100 and therefore a whole different beast, but I love the
> routine and am sometimes forced to use x-terms just because nothing
> shows up in emacs.

Ooops, I check in for the day and see myself being referred to. Now I
know what it's like to be David :-)

Ken, I would love to have STATUSLINE work in more terminals. It's a
very simple little doo-dad, which I use all the time. All it does is
use the VT100-style screen addressing escape-codes to position the
cursor at the desired location. For it to work right two things need
to happen: (a) somehow STATUSLINE needs to know what terminal it is
on, and (b) it needs to know how to position the cursor. Since EMACS
uses a "dumb" terminal I do not think this will work. [ I just tried
this using STATUSLINE, /ENABLE. ] Same probably goes for the Windows
IDE.

Comments?
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: suppressing carriage return in PRINT [message #30579 is a reply to message #30575] Tue, 07 May 2002 14:24 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Chris O'Dell wrote:
>
> Thanks Kenneth, Paul, and David.
>
> I realized via a simple test that the '($)' format qualifier would
> normally solve my problem, but for my particular calculation (involving
> a lot of matrix multiplies), for some reason the print procedure gets
> "behind" the loop, and if you use that qualifier, nothing gets printed
> until after the loop has been completed. I'm willing to bet 5 lattes
> that it wouldn't happen in linux/unix. I'm going to try out David's
> cool widget program.

That's similar behaviour I see in some Fortran output on some OSes - *particularly* unix
(good ol' VAX VMS did what I wanted....). The suppressed output doesn't get printed to
screen until a new line is begun. Sort of like flushing buffers and whatnot. I don't think
it's an IDL thing, I think it's an OS thing.

paulv

p.s. You can send me the 5 lattes in the mail. Oh, and no foam thanks. :o)

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP/EMC purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
Re: suppressing carriage return in PRINT [message #30580 is a reply to message #30579] Tue, 07 May 2002 14:06 Go to previous messageGo to next message
Christopher W. O'Dell is currently offline  Christopher W. O'Dell
Messages: 20
Registered: February 2001
Junior Member
Thanks Kenneth, Paul, and David.

I realized via a simple test that the '($)' format qualifier would
normally solve my problem, but for my particular calculation (involving
a lot of matrix multiplies), for some reason the print procedure gets
"behind" the loop, and if you use that qualifier, nothing gets printed
until after the loop has been completed. I'm willing to bet 5 lattes
that it wouldn't happen in linux/unix. I'm going to try out David's
cool widget program.

In some ways, PASCAL in 1989 was much better than IDL today.

Chris
Re: suppressing carriage return in PRINT [message #30585 is a reply to message #30580] Tue, 07 May 2002 10:54 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Kenneth Mankoff (mankoff@snoe.colorado.edu) writes:

> NOTE that one of these threads also mentions David Fannings "SHOW_PROGRESS" routine, a very
> fancy and cross-platform way that may solve your problem.

You can find the article here, if you are interested:

http://www.dfanning.com/widget_tips/show_progress.html

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: suppressing carriage return in PRINT [message #30588 is a reply to message #30585] Tue, 07 May 2002 10:33 Go to previous messageGo to next message
Kenneth Mankoff is currently offline  Kenneth Mankoff
Messages: 42
Registered: August 1999
Member
Chris O'Dell <odell@cmb.physics.wisc.edu> writes:

>> Use the Craig Markwardt routine: STATUSLINE
>
> Doesn't work in Windows, unfortunately. Neither does someone else's
> suggestion of opening my own window with a command like:
>
> openw, lun, filepath(/terminal), /get_lun
>
> (this gives you the error message):
> % FILEPATH: No terminal device available with IDLde (GUI) interface
>
> Any other ideas? Btw, i'm using 5.4.

Here are past threads on this topic, with hacks, kludges, and code-snippets
included. Most of these threads end with the statement "use STATUSLINE", so
I guess its usually us UNIX/Linux users discussing this...

http://groups.google.com/groups?hl=en&frame=right&th =efb21f4bdf4861c5&seekm=onsnfayyxh.fsf%40cow.physics.wis c.edu#link1

http://groups.google.com/groups?hl=en&frame=right&th =f440fd383be99eaa&seekm=on4s6l217l.fsf%40cow.physics.wis c.edu#link1

http://groups.google.com/groups?hl=en&frame=right&th =8fbbeb12a12eed89&seekm=k-bowman-23DD70.13052715022002%4 0news.tamu.edu#link1

NOTE that one of these threads also mentions David Fannings "SHOW_PROGRESS" routine, a very
fancy and cross-platform way that may solve your problem.

-k.
--
------------------------------------------------------------ ----------
Ken Mankoff http://lasp.colorado.edu/snoe/
http://lasp.colorado.edu/mars/
http://lasp.colorado.edu/~mankoff/ http://lasp.colorado.edu/marsrobot/
------------------------------------------------------------ ----------
Re: suppressing carriage return in PRINT [message #30591 is a reply to message #30588] Tue, 07 May 2002 10:21 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Chris O'Dell wrote:
>
> Kenneth,
>
>> Use the Craig Markwardt routine: STATUSLINE
>>
>> Craig: Is there any chance you can get this to work in EMACS? Or you
>> could give me some pointers how to modify it? I know
>> its not vt100 and therefore a whole different beast, but I love the
>> routine and am sometimes forced to use x-terms just because nothing
>> shows up in emacs.
>
> Doesn't work in Windows, unfortunately. Neither does someone else's
> suggestion of opening my own window with a command like:
> openw, lun, filepath(/terminal), /get_lun
>
> (this gives you the error message):
> % FILEPATH: No terminal device available with IDLde (GUI) interface
>
> Any other ideas? Btw, i'm using 5.4.
> Chris

This is what I use to print out the data number that has been read in some code of mine:

<--------snippet------->
;----------------------------------------------------------- -------------------
; -- Read data panel by panel --
;----------------------------------------------------------- -------------------

bksp = MAKE_ARRAY( 5, VALUE = 8B )
IF ( NOT KEYWORD_SET( quiet ) ) THEN $
PRINT, FORMAT = '( 5x, "Reading panel # : ", $ )'


; ------------------------
; Initialise some counters
; ------------------------

n_panels = 0L
n_pts_read = 0L


; --------------------------
; Begin panel read open loop
; --------------------------

WHILE 1 DO BEGIN


IF ( NOT KEYWORD_SET( quiet ) ) THEN $
PRINT, FORMAT = '( a, i5, $ )', STRING( bksp ), n_panels + 1
....etc...
<--------snippet------->

The "$" character in the first print suppresses the line feed (dunno if it works cross
platform) and the print of the "bksp" array (containing the ASCII backspace character)
overwrites the previous print of the panel number. Again, dunno if it works cross
platform.

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP/EMC purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
Re: suppressing carriage return in PRINT [message #30592 is a reply to message #30591] Tue, 07 May 2002 10:07 Go to previous messageGo to next message
Christopher W. O'Dell is currently offline  Christopher W. O'Dell
Messages: 20
Registered: February 2001
Junior Member
Kenneth,



> Use the Craig Markwardt routine: STATUSLINE
>
> Craig: Is there any chance you can get this to work in EMACS? Or you
> could give me some pointers how to modify it? I know
> its not vt100 and therefore a whole different beast, but I love the
> routine and am sometimes forced to use x-terms just because nothing
> shows up in emacs.


Doesn't work in Windows, unfortunately. Neither does someone else's
suggestion of opening my own window with a command like:
openw, lun, filepath(/terminal), /get_lun

(this gives you the error message):
% FILEPATH: No terminal device available with IDLde (GUI) interface

Any other ideas? Btw, i'm using 5.4.
Chris
Re: suppressing carriage return in PRINT [message #30593 is a reply to message #30592] Tue, 07 May 2002 09:25 Go to previous messageGo to next message
Kenneth Mankoff is currently offline  Kenneth Mankoff
Messages: 42
Registered: August 1999
Member
Chris O'Dell <odell@cmb.physics.wisc.edu> writes:

> This should be really easy. How do you print something (to the normal
> print window in IDL) without a carriage return?

Use the Craig Markwardt routine: STATUSLINE

Craig: Is there any chance you can get this to work in EMACS? Or you
could give me some pointers how to modify it? I know
its not vt100 and therefore a whole different beast, but I love the
routine and am sometimes forced to use x-terms just because nothing
shows up in emacs.

Thanks,
-k.

--
------------------------------------------------------------ ----------
Ken Mankoff http://lasp.colorado.edu/snoe/
http://lasp.colorado.edu/mars/
http://lasp.colorado.edu/~mankoff/ http://lasp.colorado.edu/marsrobot/
------------------------------------------------------------ ----------
Re: suppressing carriage return in PRINT [message #30701 is a reply to message #30575] Thu, 09 May 2002 07:00 Go to previous messageGo to next message
Kenneth Mankoff is currently offline  Kenneth Mankoff
Messages: 42
Registered: August 1999
Member
Craig Markwardt <craigmnet@cow.physics.wisc.edu> writes:

> Kenneth Mankoff <mankoff@snoe.colorado.edu> writes:
>
>> Chris O'Dell <odell@cmb.physics.wisc.edu> writes:
>>
>>> This should be really easy. How do you print something (to the normal
>>> print window in IDL) without a carriage return?
>>
>> Craig: Is there any chance you can get this to work in EMACS? Or you
>> could give me some pointers how to modify it? I know
>> its not vt100 and therefore a whole different beast, but I love the
>> routine and am sometimes forced to use x-terms just because nothing
>> shows up in emacs.
>
> Since EMACS uses a "dumb" terminal I do not think this will work.
> [ I just tried this using STATUSLINE, /ENABLE. ] Same probably
> goes for the Windows IDE.
>
> Comments?

The only way I can think that it might work is currently beyond my
ability to implement. It would require JD to implement, I think, if
it is even possible. But it would go like this:

I assume the IDLWAVE shell can interact with Emacs, in which case
STATUSLINE would have to detect its being called in Emacs (this much
I know how to do), and then issue commands to the buffer like:
'(newline-no-cr) or whatever the LISP syntax would be to return to the
beginning of the current line without a carriage-return.

Oh well... It is not important. I like statusline, but its output
is critical enough to require me to use an xterm for only a few of
the routines I run.

Maybe I will get around to learning how to implement this after I
have implemented the Perl wrapper that allows subscripting with [-1].

-k.
--
------------------------------------------------------------ ----------
Ken Mankoff http://lasp.colorado.edu/snoe/
http://lasp.colorado.edu/mars/
http://lasp.colorado.edu/~mankoff/ http://lasp.colorado.edu/marsrobot/
------------------------------------------------------------ ----------
Re: suppressing carriage return in PRINT [message #30961 is a reply to message #30579] Fri, 24 May 2002 08:41 Go to previous message
Christopher W. O'Dell is currently offline  Christopher W. O'Dell
Messages: 20
Registered: February 2001
Junior Member
Paul Van Delst wrote:

> That's similar behaviour I see in some Fortran output on some OSes - *particularly* unix
> (good ol' VAX VMS did what I wanted....). The suppressed output doesn't get printed to
> screen until a new line is begun. Sort of like flushing buffers and whatnot. I don't think
> it's an IDL thing, I think it's an OS thing.
>
> paulv
>
> p.s. You can send me the 5 lattes in the mail. Oh, and no foam thanks. :o)


I guess i can just walk them across the street, if you're at SSEC --- I
never thought I'd actually have to pay up! By the way, I ended up using
David's SHOWPROGRESS function, it works great (but is a little overkill).


-Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: EGAD! A common block question.......
Next Topic: library help -- multiple procedures in one file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 14:55:47 PDT 2025

Total time taken to generate the page: 0.00489 seconds