Least it wasn't that I'd forgotten how to write a trusty switch
statement then :o)

I've used a dirty

foo = "bar"?print("Mellow world"):null;

Mark

On Thu, 17 Feb 2005 13:26:55 +0100, Jan Hinzmann <[EMAIL PROTECTED]> wrote:
> i realised that too, and therefore am using if-else combinations now.
> 
> I think having the switch-statement working with strings depends on the
> javascript-distribution.
> 
> In java itself, you cannot "switch over strings",  but you can define 
> constants
> and switch over them.
> 
> var MY_CONSTANT1 = 1;
> var MY_CONSTANT2 = 2;
> ...
> 
> var foo = MY_CONSTANT1;
> 
> switch(foo) {
> case MY_CONSTANT1 : print("introducing a indirectionlayer");break;
> 
> case MY_CONSTANT2 : print("solves most problems in computerscience");break;
> 
> default : print("some default answer");
> }
> 
> Mark Lowe wrote:
> > I imagine that everyone's been too busy developing apps at the speed
> > of light, on the rapid application development framework known as
> > cocoon, to have noticed that switch statements don't work with
> > flowscript, at least when testing strings.
> >
> > var foo = "bar";
> >
> > switch(foo) {
> >   case "bar" : print("switch works"); break;
> >   default : print("this is a rancid crock of poo");break;
> > }
> >
> > Please tell me I'm missing something and cocoon is the best thing
> > since sliced bread.
> >
> > Mark
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> --
> Gruss, Jan Hinzmann
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to