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

Home » Public Forums » archive » Re: Bug in SWITCH - ELSE: statement?
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: Bug in SWITCH - ELSE: statement? [message #56231 is a reply to message #56230] Fri, 12 October 2007 13:40 Go to previous messageGo to previous message
Matt[2] is currently offline  Matt[2]
Messages: 69
Registered: March 2007
Member
JD,

I think it's documentation bug. Look closely at the original poster's
emphasis.

>> **The ELSE statement is executed only if none of the preceding statement expressions match.**

That line of documentation is inconsistent with the way switch works
in IDL.

Of course Jean H just pointed out.

"SWITCH executes the first matching statement and any following
statements in
the SWITCH block. Once a match is found in the SWITCH block, execution
falls
through to any remaining statements. For this reason, the BREAK
statement is
commonly used within SWITCH statements to force an immediate exit from
the
SWITCH block."

So the documentation is orthogonal as far as I can tell, and the first
statement is the wrong one.


Matt

--
Matthew Savoie - Scientific Programmer
National Snow and Ice Data Center
http://nsidc.org
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: structure into strcuture
Next Topic: How to make an attribute of the oject visible outside of the class

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

Current Time: Fri Oct 10 01:52:25 PDT 2025

Total time taken to generate the page: 1.12058 seconds