Switch,Case Structure

Ken Ray kray at sonsothunder.com
Fri May 17 13:47:01 EDT 2002


Barry,

It should actually read:

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

I get this when I type it into Rev 1.1.1 for Windows. Is your completely
flush left?

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/


----- Original Message -----
From: "Barry Levine" <themacguy at mac.com>
To: <use-revolution at lists.runrev.com>
Sent: Friday, May 17, 2002 11:57 AM
Subject: Switch,Case Structure


> 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
> --------------------------------------------------------
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list