Re: what's wrong with this? --- ' vs " problem [message #39227 is a reply to message #39224] |
Tue, 04 May 2004 07:54   |
mmiller3
Messages: 81 Registered: January 2002
|
Member |
|
|
>>>> > "David" == David Fanning <david@dfanning.com> writes:
> Michael A. Miller writes:
>> Ok, this I don"t get. Is it a 'feature' or a "bug"? I
>> vote for bug in how IDL parses octal numbers.
> Well, if it's a bug, it's been a bug for the last 20
> years. :-)
That's what I thought. And I can't for the life of me figure out
why it took so many years for me to notice it! Blech.
I did find some documentation in chapter 3 of "Building IDL
Applications", but there is more. In talking to my neighbors
about this, it was pointed out that the final ' or " is not
required to correctly delimit a string, so that all of the
following are the same string constant:
"Don't drink the water"
"Don't drink the water
'Don''t drink the water'
'Don''t drink the water
I could happily go along being unaware of this, except I wrote a
script that calls some IDL like this
echo indypet_projections, \"$img\" > do_this.pro
echo exit >> do_this.pro
idl do_this.pro > do_this.log 2>&1
sometimes this fails, depending on what the string in img is. So
I fixed it by replacing the "s with 's. But I'm not yet
convinced that I won't have cases where I need to use " to
delimit some string and ' to delimit others. So I wonder if I
need to write an IDL-like parser that can decide in advance how
to delimit strings so that IDL likes them. Of course if IDL had
a built-in mechanism for handling command line arguments, I could
let the RSI gang do that for me...
None of this fits my bias about how IDL is supposed to work,
which is exactly like I want it to that is ... I'm grudgingly
willing to count as a feature :-)
Mike
|
|
|