Re: Help needed for a CASE statement, something subtle going on ... [message #87817 is a reply to message #87782] |
Thu, 27 February 2014 09:33   |
john.hrv583
Messages: 4 Registered: February 2014
|
Junior Member |
|
|
On Wednesday, February 26, 2014 7:23:38 PM UTC-5, David Fanning wrote:
> Phillip Bitzer writes:
>
>
>
>> Then don't listen to this :-)
>
>>
>
>> If you absolutely *must* you can do this in a script. Here's the 1970's syntax (it's not pretty and *very* cumbersome)
>
>>
>
>> CASE x OF & $
>
>> 1: print, 'one' & $
>
>> 2: print, 'two' & $
>
>> 3: print, 'three' & $
>
>> 4: print, 'four' & $
>
>> ELSE: print, 'not one through four' & $
>
>> ENDCASE
>
>>
>
>> Again, this should be a last resort.
>
>
>
> I used to be one of thorough people, too. But, over the years, I've
>
> learned to give people just enough information to move one step forward.
>
> That's about all they can handle and stay productive. ;-)
>
>
>
> Cheers,
>
>
>
> David
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Hi, everyone,
Thank you all so much for your overwhelming responses and help.
Actually I am not just learning to use CASE statements in IDL, I'm learning
to use IDL per se. And as it so happened, yesterday I got stuck with the case
statement for quite a while, because I was trying out different things that
I learned recently. Basically, I had tried almost every option that you have
suggested regarding the CASE statement, but none of them worked. (In retrospect,
with your insightful explanations, I know that's because there was always something missing in my codes.) And I was really quite frustrated.
Then I thought what I really need is to find some step by step tutorials and get familiar with some of the "subtleties" of the IDL programming language. So I searched on the Internet. While doing so, I came across this discussion group. Because I did not find anything that would help solve my problem any time soon, I decided to try to ask for help in this discussion group. But I was quite unsure if I would get any response at all, because I thought although my problem is a big problem for me, people in this group might be tired of answering this kind of questions.
To my surprise, your responses proved that I am totally wrong again:-). And I think your responses are the best tutorials I can get, because in addition to solving my particular problem at hand, they also provided precise answers to some questions I have had since I started to learn IDL recently. This definitely saved me a lot of time that I would otherwise have to spend in looking for the answers in the documents etc. myself.
All in all, I really think that each and every response from you all is a treasure. And thank you so much again for your generosity in sharing your precious time and expertise!
John
P.S.: David, I intended to post my response so that everyone in the discussion group can see it. Since I am using such a discussion group for the first time,
I'm not sure if I'm doing it correctly. If not, please give me advice on how to
do it CORRECTLY. Thanks a lot in advance!
John
|
|
|