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

Home » Public Forums » archive » Re: what's wrong with this? --- ' vs " problem
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: what's wrong with this? --- ' vs " problem [message #39300 is a reply to message #39224] Wed, 05 May 2004 15:44 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 04 May 2004 19:49:45 +0200, Norbert Hahn wrote:

> mmiller3@iupui.edu (Michael A. Miller) wrote:
>
>> Ok, this I don"t get. Is it a 'feature' or a "bug"? I vote for
>> bug in how IDL parses octal numbers.
>
> It's a poor feature. A string starting with " followed by a digit
> starts an octal input, not necessarily a number. Thus your input
>
>> IDL> file=" 040301_0932_2004-00005_mouse1_12x10s-4x30s-3x120s-4x300s-pro j.jpg "
>
> make file a variable of type Int and a value of octal 040301, decimal
> 16577.
>
> If you enter file="0403010932 then the variable type is long and the
> value in decimal is 543213431.
>
> The underline character is not a valid octal digit, hence "Syntax error".

I vote for a COMPILE_OPT option turning off this "feature". Whoever
decided to use unpaired string delimeters for octal constants probably
hadn't yet written the interpreter to actually recognize those
constants. A much better syntax, should you have a need for octals,
is:

angstrom=string('305'OB)

which has the advantage that it matches the hexadecimal notation:

angstrom=string('C5'XB)

I guess we should be thankful they didn't offer 'HHH as a hexadecimal
shorthand.

JD

P.S. Use of "NNN octal notation in IDLWAVE tends to wreak havoc with
the fontification.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Fortran call_external for 2D arrays
Next Topic: Re: Announcing GDL 0.8, now with netCDF support

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

Current Time: Fri Oct 10 23:47:23 PDT 2025

Total time taken to generate the page: 1.04085 seconds