# Condition in Case Statement

**URL:** https://forum.kirupa.com/t/condition-in-case-statement/645472
**Category:** programming
**Created:** [December 27, 2020, 7:31am UTC](https://forum.kirupa.com/t/condition-in-case-statement/645472 "2020-12-27T07:31:53Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![OofieDoofie](https://avatars.discourse-cdn.com/v4/letter/o/43a26b/32.png) [@OofieDoofie](https://forum.kirupa.com/u/OofieDoofie)
#### Post date: [December 27, 2020, 7:31am UTC](https://forum.kirupa.com/t/condition-in-case-statement/645472/1 "2020-12-27T07:31:53Z")

</div>

Hi I needed help with some logic and how to approach this.  
Case 8  
`EXIT CAVE` (while taking damage from nearby monsters)

Case 9  
`MAKE WEAPON`

Case 10  
`GO TO BANK A`

Case 11  
`DEPOSIT WEAPON`

Case 12  
`WITHDRAW MORE MATERIALS`

Now I want to add a condition where After

> Case 9  
> `MAKE WEAPON`

> If Player Health is less than 30  
> `GO TO HOSPITAL`  
> and  
> Then `GET HEALED`

THEN I want it to return to Case 3 and carry on with the rest of the function.

I’m lost on how to approach this.  
Thank you.

---

<div class="post-metadata">

### Author: ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)
#### Post date: [December 27, 2020, 10:05am UTC](https://forum.kirupa.com/t/condition-in-case-statement/645472/2 "2020-12-27T10:05:16Z")

</div>

You can’t really jump around from case to case (unless you’re falling through, but that is specific to one other case and is generally discouraged). But what you can do is put all of the actions of Case 3 in a function. Then for Case 3, and any time you want to “return to Case 3”, you simply call that function.
