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

Home » Public Forums » archive » Re: STRTRIM needs improvement
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: STRTRIM needs improvement [message #3567] Tue, 21 February 1995 07:02
ryba is currently offline  ryba
Messages: 33
Registered: October 1992
Member
In article <3icn4p$6hi@reznor.larc.nasa.gov>, zawodny@arbd0.larc.nasa.gov (Joseph M Zawodny) writes:
|> In article <3i5ni5$i3t@hammer.msfc.nasa.gov> mallozzi@ssl.msfc.nasa.gov writes:
|> >Is it possible to improve STRTRIM so that I can do
|> > STRTRIM(x, F='(f5.2)', 2)
|> >instead of
|> > STRTRIM(STRING(x, F='(f5.2)'), 2)
|> >I often use the latter construction in widget programming so that
|> >displayed values have a nice format.
|>
|> Hear, hear! I find myself doing this all the time. This does, however, turn
|> STRTRIM into something other than a "string trimmer". Perhaps it might be more
|> appropriate to add the leading/trailing blank elimination function to STRING
|> instead.

Joseph is right....what is needed is for STRING() to allow a
floating format descriptor like F0.2 that works like I0...creates a
string of just enough characters to contain the float of appropriate
precision, akin to using "%.2f" in sprintf() in C. I was disappointed
to find that F0 was not allowed...I use I0 all the time. As far as
tightening up your code, you could define a function to do the
combined operation. And wouldn't STRTRIM( ,1) suffice, since STRING()
is just inserting leading, not trailing blanks?

--
Dr. Marty Ryba | Generation X:
MIT Lincoln Laboratory | Too young to be cynical,
ryba@ll.mit.edu | too old to be optimistic.
Of course nothing I say here is official policy, and Laboratory affiliation is
for identification purposes only, blah, blah, blah....
Re: STRTRIM needs improvement [message #3572 is a reply to message #3567] Tue, 21 February 1995 04:43 Go to previous message
zawodny is currently offline  zawodny
Messages: 121
Registered: August 1992
Senior Member
In article <3i5ni5$i3t@hammer.msfc.nasa.gov> mallozzi@ssl.msfc.nasa.gov writes:
>
> Dear RSI,
> Is it possible to improve STRTRIM so that I can do
> STRTRIM(x, F='(f5.2)', 2)
> instead of
> STRTRIM(STRING(x, F='(f5.2)'), 2)
> I often use the latter construction in widget programming so that
> displayed values have a nice format.

Hear, hear! I find myself doing this all the time. This does, however, turn
STRTRIM into something other than a "string trimmer". Perhaps it might be more
appropriate to add the leading/trailing blank elimination function to STRING
instead.

--
Joseph M. Zawodny (KO4LW) NASA Langley Research Center
Internet: j.m.zawodny@larc.nasa.gov MS-475, Hampton VA, 23681-0001
TCP/IP: ko4lw@ko4lw.ampr.org Packet: ko4lw@n4hog.va.usa.na
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Getting info on the whole screen in IDL
Next Topic: Re: widget for image display

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

Current Time: Wed Oct 08 09:14:00 PDT 2025

Total time taken to generate the page: 0.00444 seconds