| Re: the difference between ' and " [message #8229 is a reply to message #8228] |
Mon, 17 February 1997 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
R. Bauer <r.bauer@kfa-juelich.de> writes:
> I found that's there is a difference for using ' or " to sign numbers as
> strings.
>
> IDL> a='1'
> IDL> a="1"
>
> a="1"
> ^
> % Syntax error.
>
> The users guide said that both ' and " have the same useabilty.
>
> It's not true.
IDL has trouble with a="1" because it thinks you are trying
to make the variable "a" the octal value 1. In other words,
a = "1
This is a result of using the same alphanumeric characters
to designate octal and hexadecimal number as for the quote
characters.
If you weren't trying to make strings of numbers, whether
you used single or double quotes wouldn't matter. At least
as long as you use them consistently. :-)
Cheers!
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
|
|
|
|