# Shorthand if statement

**URL:** <https://forum.kirupa.com/t/shorthand-if-statement/318301>\
**Category:** Uncategorized\
**Created:** [January 16, 2011, 4:54am UTC](https://forum.kirupa.com/t/shorthand-if-statement/318301 "2011-01-16T04:54:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbo](https://avatars.discourse-cdn.com/v4/letter/t/7feea3/32.png) [@tbo](https://forum.kirupa.com/u/tbo)\
**Post date:** [January 16, 2011, 4:54am UTC](https://forum.kirupa.com/t/shorthand-if-statement/318301/1 "2011-01-16T04:54:28Z")

</div>

```auto

if (myBoolean){
    mc.gotoAndStop(2);
}

```

is there a way to shorten it to something like:

```auto
myBoolean ? mc.gotoAndStop(2);

```

i know how to assign a variable shorthand

```auto

var myNumber:uint = myBoolean? 1:2;

```
