{"name":"case","operator":null,"title":"case","type":"command","url":"https://community.bistudio.com/wiki/case","revid":347319,"updated":"2023-09-10T15:36:24Z","groups":["Program Flow"],"status":"ok","replaced_by":[],"games":[{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"This command is used as a keyword inside a switch structure to define a value case.\n\n> [!IMPORTANT]\n> This command **must** be written and used inside a switch construct, never stored in a variable, otherwise its behaviour is not guaranteed - see <https://foxhound.international/arma-3-sqf-grammar.html> for further explanation.","syntaxes":[{"syntax":"case b","since":null,"effect":null,"exec":null,"params":[{"name":"b","type":"Anything","optional":false,"default":null,"description":null,"types":["Anything"],"since":null,"text":"b: Anything"}],"returns":{"type":"Switch Type","types":["Switch Type"],"description":null,"text":"Switch Type"},"form":"unary","operator":null,"left":null,"right":{"text":"b","types":["Anything"]}}],"examples":[{"text":"```sqf\nswitch (_condition) do\n{\n    case 1: { hint \"1\" };\n    case 2: { hint \"2\" };\n    default { hint \"default\" };\n};\n```","code":["switch (_condition) do\n{\n\tcase 1: { hint \"1\" };\n\tcase 2: { hint \"2\" };\n\tdefault { hint \"default\" };\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Control Structures","switch","default"],"notes":[],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Program Flow","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}