polserver/testsuite/escript/switch/switch09.src

24 lines
425 B
Text
Raw Permalink Normal View History

// switch06
//
function foo2( p )
case (p)
4: return "four";
5: return "five";
"fourteen": return 14;
"thirteen": return 13;
default: return "NOTA: " + p;
endcase
endfunction
function foo( p )
return "p " + foo2(p) + " d";
endfunction
print( foo( 1 ) );
print( foo( 4 ) );
print( foo( "thirteen" ) );
print( foo( "fourteen" ) );
print( foo( 14 ) );
print( foo( 13 ) );