Switch/case difficulties

Hello, I have great difficulties with the switch/ acse argument.

The follwing code does not do anything, means even “raumnr” is logged properly (with my test output), it does not do anything with my Switch/case.

Any idea what is wrong? Thank you.

var int raumnr = temparray.get(4)
println (raumnr)
var double tempdig = new Integer((temparray.get(5)).intValue+256)/10.0
switch (raumnr)
{
case 0: println(“CASE0”)
case 1: println(“CASE1”)
case 2: println(“CASE2”)
case 3: println(“CASE3”)
//case 0: postUpdate(Temperatur_gBad, tempdig)
//case 1: Temperatur_kBad.postUpdate(tempdig)
//case 2: Temperatur_Schlaf.postUpdate(tempdig)
//case 3: Temperatur_Gast.postUpdate(tempdig)
//case 4: Temperatur_Flur.postUpdate(tempdig)
//case 5: Temperatur_Wohnen.postUpdate(tempdig)
//case 6: Temperatur_Gallerie.postUpdate(tempdig)
}

Contrary to what you might expect, I suspect that the Rules language switch statement does not work with primitives (i.e. int, long, short, float, double). Beyond that your syntax is identical to what I’ve used in my code.

Aaah Ok. Thank you. For the moment I switched to the alternative “if” way of doing it, works fine.
I might change my criteria from number to string - this might work with “case”.

Thanx.
cal