{"name":"else","operator":null,"title":"else","type":"command","url":"https://community.bistudio.com/wiki/else","revid":364827,"updated":"2024-06-16T09:33:24Z","groups":["Program Flow"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.85"},{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.85"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Executes else code when if condition returns false.","syntaxes":[{"syntax":"thenCode else elseCode","since":null,"effect":null,"exec":null,"params":[{"name":"thenCode","type":"Code","optional":false,"default":null,"description":null,"types":["Code"],"since":null,"text":"thenCode: Code"},{"name":"elseCode","type":"Code","optional":false,"default":null,"description":null,"types":["Code"],"since":null,"text":"elseCode: Code"}],"returns":{"type":"Array with [thenCode, elseCode]","types":["Array"],"description":"thenCode: Code - elseCode: Code","text":"Array with [thenCode, elseCode]\n- thenCode: Code\n- elseCode: Code"},"form":"binary","operator":null,"left":{"text":"thenCode","types":["Code"]},"right":{"text":"elseCode","types":["Code"]}}],"examples":[{"text":"```sqf\nif (a > b) then { c = 0 } else { c = 1 };\n```","code":["if (a > b) then { c = 0 } else { c = 1 };"]},{"text":"```sqf\nif (a < b) then {\n    hint \"B is greater than A\";\n} else {\n    hint \"A is greater than B\";\n};\n```","code":["if (a < b) then {\n\thint \"B is greater than A\";\n} else {\n\thint \"A is greater than B\";\n};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Control Structures","if","then"],"notes":[],"categories":["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 Operation Flashpoint version 1.85","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}