# Elseif

**URL:** <https://forum.choiceofgames.com/t/elseif/1809>\
**Category:** ChoiceScript Help\
**Created:** [October 16, 2013, 8:56pm UTC](https://forum.choiceofgames.com/t/elseif/1809 "2013-10-16T20:56:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shula](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/shula/32/191011_2.png) [@Shula](https://forum.choiceofgames.com/u/Shula)\
**Post date:** [October 16, 2013, 8:56pm UTC](https://forum.choiceofgames.com/t/elseif/1809/1 "2013-10-16T20:56:51Z")

</div>

Hello, everyone!

I’m new to ChoiceScript and have a fairly simple question:

Is it possible to use if/elseif/if with more than three options, and, if so, how does that work?

Thank you!

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [October 16, 2013, 9:01pm UTC](https://forum.choiceofgames.com/t/elseif/1809/2 "2013-10-16T21:01:39Z")

</div>

Do you mean like

```

*if (((strength=1) and (dexterity=1)) and (stamina=1))
    Stuff

```

---

<div class="post-metadata">

**Author:** ![Shula](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/shula/32/191011_2.png) [@Shula](https://forum.choiceofgames.com/u/Shula)\
**Post date:** [October 16, 2013, 9:25pm UTC](https://forum.choiceofgames.com/t/elseif/1809/3 "2013-10-16T21:25:39Z")

</div>

Oh, sorry. Let me explain better. I mean more like:

\*if blah  
this  
\*elseif blee  
that  
\*elseif bloo  
the other thing  
\*elseif blech  
this last thing

(Also, how do you write code so the forum doesn’t auto-format it?)

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [October 16, 2013, 9:36pm UTC](https://forum.choiceofgames.com/t/elseif/1809/4 "2013-10-16T21:36:09Z")

</div>

Yeah you can do as many of those are you like. There’s no limit. I generally don’t use elseif though, but that’s just me. It might help if you use the actual example of what you’re trying to do.

What I generally do, if I’m stuck is plug the code into [https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/online-cs-tester/mygame/input.html](https://dl.dropboxusercontent.com/u/7840892/CJW/choicescript/tools/online-cs-tester/mygame/input.html) and keep fiddling with it until it does what I want it to.

To write code do \< pre\> at the start and \< /pre\> at the end with no space.

---

<div class="post-metadata">

**Author:** ![Shula](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/shula/32/191011_2.png) [@Shula](https://forum.choiceofgames.com/u/Shula)\
**Post date:** [October 16, 2013, 9:44pm UTC](https://forum.choiceofgames.com/t/elseif/1809/5 "2013-10-16T21:44:47Z")

</div>

Thank you so much! That test link helped me diagnose the problem which actually had nothing at all to do with elseif. I keep learning as I go! 🙂

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [October 16, 2013, 9:50pm UTC](https://forum.choiceofgames.com/t/elseif/1809/6 "2013-10-16T21:50:43Z")

</div>

I’m so glad to hear it. The online tester helps me so much as well. I use it for troubleshooting until something works.

[http://www.choiceofgames.com/forum/discussion/1213/tool-online-choicescript-tester](http://www.choiceofgames.com/forum/discussion/1213/tool-online-choicescript-tester) is the thread. I think CJW fixed the side by side version which is even more useful.

---

<div class="post-metadata">

**Author:** ![Mystogan](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/mystogan/32/1248_2.png) [@Mystogan](https://forum.choiceofgames.com/u/Mystogan)\
**Post date:** [October 16, 2013, 9:54pm UTC](https://forum.choiceofgames.com/t/elseif/1809/7 "2013-10-16T21:54:54Z")

</div>

@FairyGodfeather  
There’s a Choicescript tester? o\_e  
Totally going to use that for about…everything.

---

<div class="post-metadata">

**Author:** ![FairyGodfeather](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fairygodfeather/32/16709_2.png) [@FairyGodfeather](https://forum.choiceofgames.com/u/FairyGodfeather)\
**Post date:** [October 16, 2013, 10:00pm UTC](https://forum.choiceofgames.com/t/elseif/1809/8 "2013-10-16T22:00:45Z")

</div>

@Mystogan Yeah, CJW made it. It’s amazing. Please do post on the thread and tell him how great it is.

---

<div class="post-metadata">

**Author:** ![Havenstone](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/havenstone/32/198451_2.png) [@Havenstone](https://forum.choiceofgames.com/u/Havenstone)\
**Post date:** [October 17, 2013, 7:48am UTC](https://forum.choiceofgames.com/t/elseif/1809/9 "2013-10-17T07:48:08Z")

</div>

One thing to remember if you’re using \*elseif and \*else is that each option needs to end in a \*goto command. So:

```

*if blah
  this
  *goto wah
*elseif blee
  that
  *goto wee
*elseif bloo
  the other thing
  *goto woo
*else blech
  this last thing
  *goto wah

```

with wah, wee, and woo referring to \*labels elsewhere in the game.
