• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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