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

Home » Public Forums » archive » Help needed for a CASE statement, something subtle going on ...
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: Help needed for a CASE statement, something subtle going on ... [message #87780 is a reply to message #87777] Wed, 26 February 2014 16:08 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
Summarizing what Craig and David have said: this all goes back to the difference in a

1) script (run with IDL>@case_st)
2) main level program (run with IDL>.run case_st
3) procedure (run with IDL>case_st

One of times I use scripts is for a "make" file for GUIs. Usually, I write procedures though. Far better programming practice.

I keep a "temp" main level program laying around to "play around" in. Usually, it's a precursor for a procedure I end up writing.

I also use main level programs as "wrappers" - usually for some sort of analysis that needs to be repeated over and over.

On Wednesday, February 26, 2014 4:57:47 PM UTC-6, David Fanning wrote:
> But, you can't execute multiple
>
> line statements such as CASE statements, FOR loops, etc at the command
>
> line. (People will tell you differently and then offer you 1970's syntax
>
> to do so. Don't listen to them.)
>
>

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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Wrapping image on polar projection
Next Topic: Re: Guide: how to call Fortran from IDL in a portable and stardard F 2003 way

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

Current Time: Thu Oct 09 20:57:12 PDT 2025

Total time taken to generate the page: 0.80154 seconds