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

Home » Public Forums » archive » Re: Case statement question
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: Case statement question [message #42836 is a reply to message #42835] Tue, 22 February 2005 15:35 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Michael Wallace wrote:
> case x of
> 0: do_this()
> 1: do_that(x)
> 2: do_that(x)
> 3: do_that(x)
> 4: do_that(x)
> 5: do_that(x)
> 6: do_that(x)
> 7: do_that(x)
> 8: do_that(x)
> 9: do_that(x)
> 10: do_something_else()
> 11: do_something_more()
> endswitch
>
> Is there a way to group 1 - 9 into a single expression rather than
> having to list each distinct number in the range?

case 1 of
(x eq 0): do_this()
(x ge 1 and x le 9 ): do_that(x)
(x eq 10): do_something_else()
(x eq 11): do_something_more()
else: message, "Error!"
endcase

?? I think the syntax is correct, but I'm not sure.

paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Singular jacobian in broyden
Next Topic: Putting bands together

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

Current Time: Sat Oct 11 09:33:04 PDT 2025

Total time taken to generate the page: 2.07728 seconds