Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / May 2005



Tip: Looking for answers? Try searching our database.

multiple arguments in switch?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JS - 31 May 2005 01:45 GMT
As I can remember this is not allowed in java:

int x, y, z;

switch(x,y,z){
   case 1,2,3:
       System.out.println("Hep");
   break;
}

But what about in JavaScript, or are there some other kind og syntax for
switch??
Richard Cornford - 31 May 2005 02:47 GMT
> As I can remember this is not allowed in java:
>
[quoted text clipped - 7 lines]
>
> But what about in JavaScript,

If the - int - was - var - and the - System.out.println - referred to a
function object then the rest of the syntax is fine in javascript. It is
extremely unlikely that that a list expression used as the Expression
for the - switch - statement, or the Expression for the - case - clause,
will do anything useful.

> or are there some other kind
> og syntax for switch??

By "some other kind og syntax" do you mean something that will do what
you want to do? That will inevitably depend on what it is you are trying
to do.

The FAQ for this group includes guidance on the asking of questions. You
would benefit form reading it.

<URL: http://www.jibbering.com/faq >

Richard.
alu - 31 May 2005 03:04 GMT
Could i recommend that you download the old-but-still-ever-so-easy-to-read
netscape client-side javascript reference manual?
It will provide the answer to most of  your everyday questions within a few
seconds.
ftp://docs-pdf.sun.com/816-6408-10/816-6408-10.pdf

-alu

> As I can remember this is not allowed in java:
>
[quoted text clipped - 8 lines]
> But what about in JavaScript, or are there some other kind og syntax for
> switch??
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.