{"name":"or","title":"or","type":"command","url":"https://community.bistudio.com/wiki/or","revid":369315,"updated":"2024-09-03T18:42:56Z","groups":["Math","Variables"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","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","params":[{"name":"a","type":"Boolean","description":"test condition or variable","type_expr":"Boolean"},{"name":"b","type":"Boolean","description":"test condition or variable","type_expr":"Boolean"}],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"binary","left":{"text":"a"},"right":{"text":"b"}},{"syntax":"a or b","since":"arma2oa 1.62","params":[{"name":"a","type":"Boolean","description":"test condition or variable","type_expr":"Boolean"},{"name":"b","type":"Code","description":"code that returns Boolean. It is not evaluated if *a* returns true","type_expr":"Code"}],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"binary","left":{"text":"a"},"right":{"text":"b"}}],"examples":[{"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};"]}],"aliases":["a or b"],"see_also":["a or b","and","Operators"]}