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

Home » Public Forums » archive » Re: Single Quotes, Double Quotes
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: Single Quotes, Double Quotes [message #11758 is a reply to message #11757] Thu, 14 May 1998 00:00 Go to previous messageGo to previous message
korpela is currently offline  korpela
Messages: 59
Registered: September 1993
Member
In article <MPG.fc4d67beb3ea90d989792@news.frii.com>,
David Fanning <davidf@dfanning.com> wrote:
> I don't know the "official" answer, but I suspect it has
> to do with the way octal and hexadecimal numbers are
> specified in IDL.

I thought this at first, but proved myself wrong.

> For example, to create a hexadecimal number:
> IDL> a = "f4"x

> Thus, if the "thing" you are assigning to a variable
> is a number (but you want it as a string), you must use
> single quotes or it will be mistaken for a hexadecimal
> or octal number.

The proof that this is wrong is that attempting to create a
hexidecimal number with "number"x fails if the string starts
with a number.

IDL> a="1f"x

a="1f"x
^
% Syntax error.

Even hex and octal numbers must be created with 'number'x
to ensure success.

An interesting aside is that the following succeeds.
(IDL doesn't check that the string converted can actually
be converted sucessfully).

IDL> a="mmmm"x
IDL> print,a
-278606233

Eric
--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href="http://sag-www.ssl.berkeley.edu/~korpela">Click for home page.</a>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: contour and backingstore
Next Topic: IDL Object Graphics Update

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

Current Time: Sat Oct 11 17:21:15 PDT 2025

Total time taken to generate the page: 0.01001 seconds