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

Home » Public Forums » archive » STRING(/PRINT) bug?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
STRING(/PRINT) bug? [message #724] Wed, 04 November 1992 15:57
deutsch is currently offline  deutsch
Messages: 19
Registered: February 1992
Junior Member
Is this a bug or just the way it is:

IDL> print,strtrim(string('366,2',/print),2)
366,2
IDL> print,strtrim(string('(366 2)'),2)
(366 2)
IDL> print,strtrim(string('(366,2)',/print),2)
% "(366,2)"
% ^
% Repetition count not allowed with ",".
% Execution halted at STARCHCK2 </home/idlv2/deutsch/img/starchck2.pro( 55)>
(STRING).
% Called from IMGCLEAN </home/idlv2/deutsch/img/imgclean.pro( 163)>.
% Called from $MAIN$ .


It seems that IDL is interpreting my string as a format, although there is
no other argument which could be the the object of the format. This only
happens when the PRINT keyword is set.

Using the regular prints statement, IDL seems to know the difference:

IDL> print,'(366,2)'
(366,2)


At the moment, I'm working around this by first checking the data type of
the argument to string: if it's a string, I turn PRINT off, if it's anything
else I use /PRINT. This seems a little unnecessary...

Is this problem a bug left over from before the Keyword era, or the way it's
supposed to be?

Note to the users of the Astronomy Library, this affects the use of the
STRN and VECT functions...

IDL> print,strn(vect([100,200]),length=20)

will not work....


Eric Deutsch
University of Washington Astronomy
[Message index]
 
Read Message
Previous Topic: Re: using wave filename command in WAVE v4.00
Next Topic: gridding

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

Current Time: Sat Oct 11 02:27:23 PDT 2025

Total time taken to generate the page: 0.40177 seconds