switch case question

Sarah Reichelt sarah.reichelt at gmail.com
Sat Oct 21 17:49:21 EDT 2006


On 10/22/06, Mark Swindell <mdswindell at cruzio.com> wrote:
> I have a global variable gTimedTest
>
> Depending on whether it is empty or not I want to do different things
> in a handler
>
> How do I write this to make it happen with a switch control structure?
>
> switch gTimedTest
>
> case empty
> stuff
> break
>
> case not empty
> other stuff
> break
>
> end switch
>
> The above doesn't work... what is the proper syntax or approach?
>


Untested, but how about:

switch (the length of gTimedTest)
case 0
-- if it's empty
...
break
default
-- everything else
...
end switch

HTH,
Sarah



More information about the use-livecode mailing list