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 #42835 is a reply to message #42834] Tue, 22 February 2005 15:37 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Michael Wallace writes:

> 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?

I can't tell if this is too obvious or I'm being dense:

case x of
0: do_this()
10: do_something_else()
11: do_something_more()
else: do_that(x)
endcase

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[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 01:08:28 PDT 2025

Total time taken to generate the page: 2.24729 seconds