Re: suppressing carriage return in PRINT [message #30575] |
Tue, 07 May 2002 18:47  |
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 #30588 is a reply to message #30585] |
Tue, 07 May 2002 10:33   |
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   |
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 #30961 is a reply to message #30579] |
Fri, 24 May 2002 08:41  |
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
|
|
|