# Using brackets in if statements

**URL:** <https://forum.xojo.com/t/using-brackets-in-if-statements/11281>\
**Category:** General\
**Created:** [September 29, 2013, 2:17pm UTC](https://forum.xojo.com/t/using-brackets-in-if-statements/11281 "2013-09-29T14:17:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oliver\_Scott-Brown](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/8baadc/32.png) [@Oliver\_Scott-Brown](https://forum.xojo.com/u/Oliver_Scott-Brown)\
**Post date:** [September 29, 2013, 2:17pm UTC](https://forum.xojo.com/t/using-brackets-in-if-statements/11281/1 "2013-09-29T14:17:11Z")

</div>

How do you write if statements with brackets in like this:

> [@](#):
>
> dim this, that, theOther as Boolean
> 
> if (this or that) and theOther then
> 
> end if

I get the error ‘You have used an operator that is not compatible with the data type specified.’

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Johnny\_Harris](https://forum.xojo.com/user_avatar/forum.xojo.com/johnny_harris/32/1987_2.png) [@Johnny\_Harris](https://forum.xojo.com/u/Johnny_Harris)\
**Post date:** [September 29, 2013, 2:48pm UTC](https://forum.xojo.com/t/using-brackets-in-if-statements/11281/2 "2013-09-29T14:48:48Z")

</div>

I copied and pasted the code above into Xojo and it compiled just fine.

---

<div class="post-metadata">

**Author:** ![DaveS](https://forum.xojo.com/letter_avatar_proxy/v4/letter/d/848f3c/32.png) [@DaveS](https://forum.xojo.com/u/DaveS)\
**Post date:** [September 29, 2013, 3:07pm UTC](https://forum.xojo.com/t/using-brackets-in-if-statements/11281/3 "2013-09-29T15:07:18Z")

</div>

What are the DATATYPES of “this”, “that” and “theOther”

the only way I could compile it is if all 3 were BOOLEAN

otherwise I got “Type mismatch error. Expected Boolean, but got Int32”

if This, That and theOther are NOT simple variables, then the issue is something else

but in any case you have not provided enough information to answer your question

---

<div class="post-metadata">

**Author:** ![Oliver\_Scott-Brown](https://forum.xojo.com/letter_avatar_proxy/v4/letter/o/8baadc/32.png) [@Oliver\_Scott-Brown](https://forum.xojo.com/u/Oliver_Scott-Brown)\
**Post date:** [September 29, 2013, 3:17pm UTC](https://forum.xojo.com/t/using-brackets-in-if-statements/11281/4 "2013-09-29T15:17:25Z")

</div>

Thanks, I now think the code error lies somewhere else. Sorry to waist your time.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 4:52pm UTC](https://forum.xojo.com/t/using-brackets-in-if-statements/11281/5 "2020-10-29T16:52:21Z")

</div>


