metropoj
21st February 2007, 17:07
CASE Stmt Syntax, a simple Question ?

Been using CASE stmt's in Baan Script but never used an "Else" option before. Is there such an option?

My stmt is as follows in Baan script:

companynum = get.compnr()
on case companynum
case 340:
reportgrp = 34
break
case 430:
reportgrp = 43
break
end case

I want to insert a CASE ELSE after case 430 (if there is such a thing) to make the reportgrp option to 1 if none of the above company conditions are met ....

Thx !

george7a
21st February 2007, 17:30
Hi,

You can use the "default" option. There are some good example in the following links:
http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_string_expressions_on_case
http://www.baanboard.com/programmers_manual_baanerp_help_3gl_features_long_expressions_on_case

I hope it helps,

- George

gfasbender
21st February 2007, 17:33
on case companynum
case 340:
reportgrp = 34
break
case 430:
reportgrp = 43
break
default:
..............
end case

metropoj
21st February 2007, 17:34
Ahhhh ! DEFAULT:

OK, thx ! I knew it had to be a simple Syntax issue. I just couldn't for the life of me remember what though .....

Thx again ...

metropoj
21st February 2007, 17:35
thx for the syntax guys ... !