[Year 12 SofDev] A question

Mark Kelly kel at mckinnonsc.vic.edu.au
Fri Oct 12 13:32:24 EST 2007


In the CASE statement in Visual Basic, if more than one case is true 
only one (the first) case is evaluated.

So in the following example, only the message "A<6" appears even though 
the second and third cases are also true.

A=3
SELECT CASE A
	CASE <6: MSGBOX "A<6"
	CASE 3 : MSGBOX "A=3"
	CASE >0: MSGBOX "A>0"
END SELECT

I'm curious if this is the standard behaviour in every language's 
implementation of the CASE statement.

One of my students made a clever, but probably wrong, answer to VITTA SD 
exam 2, Q10c.

Regards
Mark

-- 
Mark Kelly
Manager - Information Systems
McKinnon Secondary College
McKinnon Rd McKinnon 3204, Victoria, Australia
Direct line / Voicemail: 8520 9085
School Phone +613 8520 9000
School Fax +613 95789253
kel AT mckinnonsc.vic.edu.au

Webmaster - http://www.mckinnonsc.vic.edu.au
IT Lecture notes: http://vceit.com
Moderator: IT Applications Mailing List

You'll know when we are officially a civilised race: our schools have 
all the money they need and the Air Force has to run a chook raffle to 
buy a new bomber.



More information about the sofdev mailing list