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

Home » Public Forums » archive » Re: Where's the syntax error? No stringst that only contain numbers?
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: Where's the syntax error? No stringst that only contain numbers? [message #50193] Tue, 19 September 2006 00:42 Go to next message
Ingo von Borstel is currently offline  Ingo von Borstel
Messages: 54
Registered: September 2006
Member
Thanks a lot to David and Jean!

Your suggestion works nicely. And sometimes IDL's string definitions are
just driving me mad... :(

Best regards,
Ingo

--
Ingo von Borstel <newsgroups@planetmaker.de>
Public Key: http://www.planetmaker.de/ingo.asc

If you need an urgent reply, replace newsgroups by vgap.
Re: Where's the syntax error? No stringst that only contain numbers? [message #50207 is a reply to message #50193] Mon, 18 September 2006 10:02 Go to previous messageGo to next message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
try plot, x,y,xtitle='1',ytitle='2' (single quote)

Jean

Ingo von Borstel wrote:
> Hello,
>
> when calling the plot routine, I found that I cannot use all kind of
> strings as title strings:
> Quote:

> IDL> x = [1,2,3,4,5,6]
> IDL> y = [1,2,3,4,7,8]
> IDL> plot, x,y,xtitle="x",ytitle="y"
> IDL> plot, x,y,xtitle="1",ytitle="2"
>
> plot, x,y,xtitle="1",ytitle="2"
> ^
> % Syntax error.
> IDL>
>

> I get no syntax error in the first case and one in the second. I don't
> really see why. Especially as the examples are to my eyes exactly alike.
> Are strings, that contain only figures not allowed?
> I'm using IDL 6.1
>
> Regards,
> Ingo
Re: Where's the syntax error? No stringst that only contain numbers? [message #50208 is a reply to message #50207] Mon, 18 September 2006 09:57 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ingo von Borstel writes:

> when calling the plot routine, I found that I cannot use all kind of
> strings as title strings:
> Quote:

> IDL> x = [1,2,3,4,5,6]
> IDL> y = [1,2,3,4,7,8]
> IDL> plot, x,y,xtitle="x",ytitle="y"
> IDL> plot, x,y,xtitle="1",ytitle="2"
>
> plot, x,y,xtitle="1",ytitle="2"
> ^
> % Syntax error.
> IDL>
>

> I get no syntax error in the first case and one in the second. I don't
> really see why. Especially as the examples are to my eyes exactly alike.
> Are strings, that contain only figures not allowed?
> I'm using IDL 6.1

IDL thinks you are trying to create an octal constant,
not a string. Use single quotes here and you will be
set. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Where's the syntax error? No stringst that only contain numbers? [message #50285 is a reply to message #50208] Tue, 19 September 2006 11:15 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Mon, 18 Sep 2006 10:57:06 -0600, David Fanning wrote:

> IDL thinks you are trying to create an octal constant,
> not a string. Use single quotes here and you will be
> set. :-)

Whoever invented the notation "n for an octal constant should be taken
out and shot, or at least go through an extreme de-tox treatment to
remove whatever substance must have been influencing them at the time.

Consider this cornucopia of consistency:

IDL> a="12
IDL> help,a
A INT = 10
IDL> a= "18
IDL> help,a
A INT = 1
IDL> a= "81
IDL> help,a
A STRING = '81'

not to mention that all those loose double-quotes really mess up
string formatting. I recommend the far more sensible:

IDL> a='12'O

possibly coupled with a stern note to ITTVIS suggesting they provide
an option to disable the former brain-dead notation.

JD
Re: Where's the syntax error? No stringst that only contain numbers? [message #50290 is a reply to message #50193] Tue, 19 September 2006 04:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ingo von Borstel writes:

> Your suggestion works nicely. And sometimes IDL's string definitions are
> just driving me mad... :(

I take it you are not a Java programmer. :-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: A new puzzle for histogram
Next Topic: spawn and 'ls *.out'

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

Current Time: Wed Oct 08 17:38:47 PDT 2025

Total time taken to generate the page: 0.00748 seconds