switch case grammar?

0
Is there any grammar like "swith -case " or nest in  "if.. then.. else..",and  how to complete this function ? Thanks very much!
asked
3 answers
0

the problem is that the sequence of if statments return a string while an integer is defined as datatype.

So change the type of variable in to string should solve the problem

answered
0

Hi Jinbiao,

I think what you are looking for is a statement like:

 

If <condition 1> then “Do stuff”

else if <condition2> then “Do other stuff”

else if <condition3> then “Do something else”

else “Execute this part”

 

Hope this helps!

answered
0

it doesn’t work.

answered