• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] "case"-function?

Status
Not open for further replies.
Level 10
Joined
Jul 14, 2004
Messages
463
Simple question:
Is there any similar function in JASS which checks different values of the same variable, such like the "switch/case"-function in C++:
---CODE---
switch (variable)
case possible value: code to execute;
case another possible value: code;
...
default: code;
break;
---/CODE---

I really like this statement although you can of course also do the same using different ifs...
So if there is any please describe how to use it! :)
 
Level 7
Joined
May 6, 2005
Messages
390
Waldbär said:
Simple question:
Is there any similar function in JASS which checks different values of the same variable, such like the "switch/case"-function in C++:
Code:
switch ([i]variable[/i])
case [i]possible value[i]: [i]code to execute[/i];
case [i]another possible value[i]: [i]code[/i];
...
default: [i]code[/i];
break;

I really like this statement although you can of course also do the same using different ifs...
So if there is any please describe how to use it! :) [/i][/code]

I'm not sure what you're talking about, but if such a script exists you can most likely find it at The JASS Vault.
 
Status
Not open for further replies.
Top