Web Development
10 replies
by tclere
by james2933
A switch is a better way of doing an if statement if there are multiple outcomes. for example if the variable = 'blue' then do this if the variable='green' do this... To make the process easier you create a case or switch statement that says, depending on the variable switch to that case. In the example below you can see an example of a select case in VB/ASP.
select case var_nam
case 'red'
'do whatever
case 'green'
'do whatever else
case 'blue'
'do more stuff
end select
The case statement allows you to expand the possible cases easily. Hope this helps.
Anthony Biondo
Senior Web Developer
Keystone Mercy Health Plan
by james2933
by rsv
HI,
SWITCH in javascript is just a better way of programming instead of if...endif statement.
SWITCH:
Enables the execution of one or more statements when a specified expression's value matches a label.
Syntax
switch (expression) {
caselabel :
write something
case label :
write something
...
default :
write something
}
Hope this is what u r looking for...:)
by james2933
by james2933
HOW ARE PAGES USED IN ANAMATION?
WHAT IS A PROGRAM SWITCH? AND NAME ONE USE FOR IT... GW BASIC PROGRAM
by laurenm
by james2933
by james2933
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending