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

Home » Public Forums » archive » Re: Octals
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: Octals [message #27213 is a reply to message #27131] Thu, 11 October 2001 22:20 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Martin Downing" <martin.downing@ntlworld.com> writes:

> "Reimar Bauer" <r.bauer@fz-juelich.de> wrote in message
> news:3BC5C1D5.9FB46B1C@fz-juelich.de...
>> Martin Downing wrote:
>>>
>>> IDL> title = "frequency " + string('52'Ob) + " wavelength"
>>
>> Normaly we should always use ' for strings.
>>
>> Because " with numbers gives an octal number, e.g.
>>
>> IDL> print, "10
>> 8
>
>
> Well if anyone reading my code misread "frequency" as an octal number,
> then I humbly appollogise!
> Your right though, but Im afraid use of double quotes for strings is deep
> seated
> for me from C/C++. NOw we are on the topic, I've got to say that
> interpreting "01 as shorthand for
> octal 01 was just a daft overload of the language, it really seems
> half-baked, look at these examples for illustration:
> ... deleted ...

I wholeheartedly agree, the double-quotes-is-octal thing is definitely
a loser. The single-quotes-is-hexadecimal works for me, but somehow I
am pretty used to it. While I am always pretty much aligned with 100%
backwards compatibility, octal constants are one thing that I
definitely feel should be removed (except for the Mac OS X version?).

If you see them in new code, run, don't hide. If you see them in old
code, change them fast! They can be achieved much more reliably with
single quotes.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Titles
Next Topic: Passing strings to CALL_EXTERNAL

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

Current Time: Sun Oct 12 07:35:12 PDT 2025

Total time taken to generate the page: 1.43714 seconds