Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Case statement?

Former Member
0 Likes
436

Hi friends i am not gettingthe out put for case statement like my code is..

Parameters: a type i.

case 'X'.

when 10.

write: 'ten'.

when 20.

write: 'twenty'.

when others.

write 'others'.

endcase.

but i am failing to get the output with the above code can any one help me with the above wheather i am going wwrong with commos or syntax error.

Edited by: Alvaro Tejada Galindo on Mar 18, 2008 5:19 PM

3 REPLIES 3
Read only

Former Member
0 Likes
401

use this..

Parameters: a type i.

case a.

when 10.

write: 'ten'.

when 20.

write: 'twenty'.

when others.

write 'others'.

endcase.

regards,

venkat.

Read only

Former Member
0 Likes
401

Chang ur code to:

Parameters: a type i.

Case a.

when 10.

write: 'ten'.

when 20.

write: 'twenty'.

when others.

write 'others'.

endcase.

since ur variable is a.

Read only

Former Member
0 Likes
401

You should write this way

parameter: x type i.

case X.when 10.

write: 'ten'.

when 20.

write: 'twenty'.

when others.

write 'others'.

endcase.

No single quotes for X.