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

Home » Public Forums » archive » Re: Code cluttered with 'STRTRIM(variable,2)' ?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Code cluttered with 'STRTRIM(variable,2)' ? [message #5006 is a reply to message #5005] Fri, 15 September 1995 00:00 Go to previous messageGo to previous message
volker is currently offline  volker
Messages: 3
Registered: April 1995
Junior Member
William Thompson (thompson@orpheus.nascom.nasa.gov) wrote:
: Russ Welti <rwelti@chroma.mbt.washington.edu> writes:

: >A nit that has plagued me since day 1 in IDL is:
: >What is the best way to formulate strings which contain
: >variables' values without getting all cluttered up with
: >strtrim(variable,2) ?? This really uglifies my code.

: >Example:
: >>msg=$
: >>'Warning: '+strtrim(n_sizes,2)+' size combinations fitted against '+$
: > strtrim(n_peaks,2)+' peak combinations means '+ $
: > strtrim(n_sizes*n_peaks,2)+' individual curve fits will be done.'
: >>print,msg

Perhaps you try:
IDL> print, 'test',1
test 1

But as you see, there are lots of spaces.
Another way is:

IDL> test = strtrim([n_sizes, n_peaks, n_sizes*n_peaks],2)
; All Variables must be of the same type
IDL> msg=$
IDL> 'Warning: '+test(0)+' size combinations fitted against '+$
IDL> test(1)+' peak combinations means '+ $
IDL> test(2)+' individual curve fits will be done.'
IDL> print, msg


ciao
volker

--
Volker Groll
uni: Ludwig Maximilians Universit"at, Institut f"ur Medizinische Optik,
Abteilung Theoretische Biophysik, Theresienstr. 37, 80333 M"unchen
Raum 204, Tel.: 089/2394-4107
e-mail: Volker.Groll@imo.physik.uni-muenchen.de
privat: Fritz-Berne-Str. 54, 81241 M"unchen
Tel.: 089 / 8340723
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL and Windows 95
Next Topic: Please help! Want N-D wavelets in PV-WAVE

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

Current Time: Wed Oct 08 17:29:55 PDT 2025

Total time taken to generate the page: 0.00385 seconds