'Case of'?
Posted: Thu Feb 27, 2003 1:46 pm
Hi,
Is there in MoHAA scripting language a 'case' type command? I mean, a command that does another thing when a variable has another value. In Turbo Pascal there was something like this (here I coloured the code like TP's editor would do):
case variable of
1: writeln("Variable''s value = 1");
2: writeln("Variable''s value = 2");
etc. etc.
end;
I think you know what I mean. I tried to do something with switch, but it gave a strange effect, maybe I did something wrong.
Rookie One
Is there in MoHAA scripting language a 'case' type command? I mean, a command that does another thing when a variable has another value. In Turbo Pascal there was something like this (here I coloured the code like TP's editor would do):
case variable of
1: writeln("Variable''s value = 1");
2: writeln("Variable''s value = 2");
etc. etc.
end;
I think you know what I mean. I tried to do something with switch, but it gave a strange effect, maybe I did something wrong.
Rookie One