{"name":"or","operator":null,"title":"or","type":"command","url":"https://community.bistudio.com/wiki/or","revid":369315,"updated":"2024-09-03T18:42:56Z","groups":["Math","Variables"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"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.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns true if one or both conditions are true. In case of the alternative syntax, [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation#Control_structures) is used. That means that if left operand is true, evaluation of the right side is skipped completely.","syntaxes":[{"syntax":"a or b","since":null,"effect":null,"exec":null,"params":[{"name":"a","type":"Boolean","optional":false,"default":null,"description":"test condition or variable","types":["Boolean"],"since":null,"text":"a: Boolean - test condition or variable"},{"name":"b","type":"Boolean","optional":false,"default":null,"description":"test condition or variable","types":["Boolean"],"since":null,"text":"b: Boolean - test condition or variable"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"binary","operator":null,"left":{"text":"a","types":["Boolean"]},"right":{"text":"b","types":["Boolean"]}},{"syntax":"a or b","since":"arma2oa 1.62","effect":null,"exec":null,"params":[{"name":"a","type":"Boolean","optional":false,"default":null,"description":"test condition or variable","types":["Boolean"],"since":null,"text":"a: Boolean - test condition or variable"},{"name":"b","type":"Code","optional":false,"default":null,"description":"code that returns Boolean. It is not evaluated if *a* returns true","types":["Code"],"since":null,"text":"b: Code - code that returns Boolean. It is not evaluated if *a* returns true"}],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"binary","operator":null,"left":{"text":"a","types":["Boolean"]},"right":{"text":"b","types":["Code"]}}],"examples":[{"text":"```sqf\nif (_obj1 or (_enemycount == 0) or (not alive _enemyGeneral)) then { hint \"you win !\"; };\n```","code":["if (_obj1 or (_enemycount == 0) or (not alive _enemyGeneral)) then { hint \"you win !\"; };"]},{"text":"```sqf\n// without lazy evaluation, select would throw an error in the event of an empty array\nif ((count _array == 0) or { (_array select 0) != player }) then\n{\n    hint \"It works!\";\n};\n```","code":["// without lazy evaluation, select would throw an error in the event of an empty array\nif ((count _array == 0) or { (_array select 0) != player }) then\n{\n\thint \"It works!\";\n};"]}],"multiplayer":null,"problems":null,"aliases":["a or b"],"see_also":["a or b","and","Operators"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Math","Command Group: Variables","Introduced with Operation Flashpoint version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}