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 #56230] Fri, 12 October 2007 13:56 Go to previous message
R.G.Stockwell is currently offline  R.G.Stockwell
Messages: 163
Registered: October 2004
Senior Member
"Matt" <savoie@nsidc.org> wrote in message
news:1192221602.770405.43150@q5g2000prf.googlegroups.com...
>
> 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.


Right, looks like someone copy and pasted that paragraph from the
CASE statement help file.
It is correctly described in the previous paragraph though.

For the SWITCH help, it really should state:

**The ELSE statement is executed only if none of the preceding statement
expressions match,
or it any of the preceding statement expressions match.**

:)


Cheers,
bob
[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: Wed Oct 08 15:34:40 PDT 2025

Total time taken to generate the page: 0.00454 seconds