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 #27131 is a reply to message #27128] Thu, 11 October 2001 11:37 Go to previous messageGo to previous message
Martin Downing is currently offline  Martin Downing
Messages: 136
Registered: September 1998
Senior Member
"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:

IDL> help, "1034
<Expression> INT = 540
; OK....

IDL> help, "1034r
help, "1034r
^
% Syntax error.
; fair enough

IDL> help, "10349673
<Expression> INT = 540
; *&*&*??????
IDL> help, "910349673
<Expression> STRING = '910349673'

IDL LOGIC: "Digits 8 or 9 indicate that the string is indeed a string if
they appear first, if they appear later on then let's just discard them -
surely the programmer didnt want them anyway..."

cheers

Martin
[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: Wed Oct 08 17:52:52 PDT 2025

Total time taken to generate the page: 0.00462 seconds