Switch,Case Structure

Barry Levine themacguy at mac.com
Fri May 17 12:05:00 EDT 2002


I'm trying to understand the "Switch/Case" structure and having a hard 
time.

Let's say I've got a value in myVar that could be anything from 1 to 3. 
I want to call a handler specific to that value and not any other 
handler after that. Let's say "doOne", "doTwo", "doThree". According to 
how I understand the Rev docs on this subject, I would create this:

switch (myVar)
	case 1
		doOne
		break
	case 2
		doTwo
		break
	case 3
		doThree
		break
end switch

When I do this in my handler, the switch and case lines are aligned 
rather than indented so I've probably pooched something. Any ideas?

Thanks,
Barry
--------------------------------------------------------
Barry Jay Levine
"The Mac Guy"
Macintosh Troubleshooting, System Engineering, Training,
AppleShare/OSX Server Setup, System Upgrades and Enhancements
On-Site service for K20, Business, Consumer
Phone/VoiceMail: 915-581-1105
             Fax: 915-581-8167
           eMail: themacguy at mac.com
--------------------------------------------------------




More information about the use-livecode mailing list