{"name":"case","title":"case","type":"command","url":"https://community.bistudio.com/wiki/case","revid":347319,"updated":"2023-09-10T15:36:24Z","groups":["Program Flow"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","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","params":[{"name":"b","type":"Anything","type_expr":"Anything"}],"returns":{"type":"Switch Type","type_expr":"Switch Type"},"form":"unary","right":{"text":"b"}}],"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};"]}],"see_also":["Control Structures","switch","default"]}