# New ChoiceScript features: implicit control flow, gosub parameters

**URL:** <https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042>\
**Category:** Announcements\
**Tags:** choicescript-updates\
**Created:** [August 27, 2017, 6:09am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042 "2017-08-27T06:09:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfabulich](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/dfabulich/32/198373_2.png) [@dfabulich](https://forum.choiceofgames.com/u/dfabulich)\
**Post date:** [August 27, 2017, 6:09am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/1 "2017-08-27T06:09:28Z")

</div>

Thanks to a big code contribution from @kgold, there are new features to try in the latest version of ChoiceScript up on GitHub: implicit control flow and `*gosub` parameters.

## Implicit control flow

Normally, you have to use a `*goto` before the end of a `*choice` `#option` or before an `*else`, or you’ll get errors like this:

> It is illegal to fall out of a \*choice statement; you must \*goto or \*finish before the end of the indented block.  
> It is illegal to fall in to an \*else statement; you must \*goto or \*finish before the end of the indented block.

With implicit control flow, those errors go away; ChoiceScript will just skip over subsequent `#options` or `*else` blocks automatically.

Implicit control flow is off by default. To use it, you have to `*create implicit_control_flow true` in `startup.txt`. (You can also `*set implicit_control_flow true` or `false` in other places in your scene files.)

When implicit control flow is enabled, `*choice` works basically the same as `*fake_choice`, except you can also freely nest a `*choice` inside another `*choice` with implicit control flow.

Implicit control flow is convenient, but it can also make it harder to find bugs, like this one.

```choicescript
*choice
    #Be very naughty.
        Santa refuses to give you a present.
    #Be mostly nice.
        Santa gives you a present reluctantly.
    #Be as nice as can be.
        Santa gives you a present enthusiastically.

Inside the gift box is a video game!

```

In this example of implicit control flow, you still get a present even if you’re very naughty. It can be hard to catch this bug when you have long `#options` that fill a few screens of text.

ChoiceScript’s traditional approach (“explicit control flow”) forces you to add a `*goto` before `#Be mostly nice`; if you give the label a good name, like `*label present`, the error should be easier to find, like this:

```choicescript
*choice
    #Be very naughty.
        Santa refuses to give you a present.
        *goto present    
    #Be mostly nice.
        Santa gives you a present reluctantly.
        *goto present
    #Be as nice as can be.
        Santa gives you a present enthusiastically.

*label present
Inside the gift box is a video game!

```

This bug may be easier to find, because “refuses to give you a present” is right next to `*goto present` which is clearly wrong.

It’s possible that everybody will love ICF so much that we’ll enable it by default at some point. It certainly makes it easier to get your ideas down on the page; we’ll see if it comes at the expense of having more bugs.

## `*gosub` parameters and `*params`

This one’s for the programmer-ish folks out there. Now you can write code like this:

```choicescript
*gosub visit "Dracula" "garlic"

*label visit
*params
You go to visit ${param_1} and you bring ${param_2} with you.
*return

```

After the `*gosub` label, you can include any number of parameters. When you use the `*params` command, it sets temps named `param_1`, `param_2`, etc. for each parameter. (It also sets a `param_count` temp with the number of parameters; in this case, `param_count` would be 2.)

Since `param_1` and `param_2` are not very good names, you might be tempted to write some code like this:

```choicescript
*params
*temp person param_1
*temp gift param_2

```

We anticipated that; you can just write the names of the parameters after `*params` and we’ll set the temps for you, like this:

```choicescript
*label visit
*params person gift
You go to visit ${person} and you bring ${gift} with you.
*return

```

You can also use parameters with `*gosub_scene`. `*gosub_scene` already allows you to optionally specify a label, e.g. `*gosub_scene travel visit` so if you want to pass in parameters to `*gosub_scene`, you _must_ specify a label name. `*gosub_scene visit "Dracula"` won’t use a parameter; it will try to `*gosub` the label “Dracula”.

Programmer-ish people should note that parameters are just ordinary `*temp`s and are scoped to the entire file, not the subroutine. Thus, if you `*gosub` within a `*gosub`, `param_1` can and will be changed in the second subroutine and will not be restored when you `*return`.

However, `*gosub_scene` defines a new scope for `*temp`, so if you want your `*params` to be scoped to the subroutine, (for example if you want to use recursion,) you can use `*gosub_scene` instead of `*gosub`.

Here’s an example of a naive recursive Fibonacci subroutine. (Note that it can only work with `*gosub_scene`; it wouldn’t work with `*gosub` because of parameter scopes.)

```choicescript
*create return 0

*gosub_scene startup fib 6
${return}

*finish

*label fib
*params n
*if n < 2
  *set return 1
  *return
*gosub_scene startup fib (n-1)
*temp prev return
*gosub_scene startup fib (n-2)
*set return +prev
*return

```

Let us know if you run into bugs with these new features!

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [August 27, 2017, 7:38am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/2 "2017-08-27T07:38:39Z")

</div>

Hfffttt… Woowheeee! It’s finally here! 😲 😁

My eyes enjoy reading every single letter of this… update? Patchnote? Changelog?

Anyway, I’d like to give @dfabulich, @kgold, and anyone that helps on making this change possible my personal reserve of ☕ coffees and 🍪 cookies.

---

<div class="post-metadata">

**Author:** ![kgold](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/kgold/32/146832_2.png) [@kgold](https://forum.choiceofgames.com/u/kgold)\
**Post date:** [August 27, 2017, 1:28pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/3 "2017-08-27T13:28:45Z")

</div>

I’ll point out that my WIP Choice of Magics has been using this change for a while, is at 320,000 words so far, and has had friends playtest several chapters. So, it’s pretty robust. The thing that I use the gosub parameters for is mostly stat changes, where you avoid bugs by having a single gosub handle both the change in stat and the reporting to the player. So if I say

\*gosub bump “vivomancy” 2

then the player sees (Gained Vivomancy) and vivomancy increases 2, and if I ever decide that it’s better to say “(Gained 2 Vivomancy)” I just have to change this in one place instead of all over the place.

There’s also a tiny bug (?) that would be a pain to fix but is very easy to work around. You can’t goto into the middle of a different choice from the one you’re in and expect that to work properly; the interpreter needs to hit the original \*choice in order to know where to jump out to. This is always fixable by using gosub instead of goto. So don’t do this:

```

*choice
      #A 
             *goto mylabel
      #B
             blah blah

*choice
      #C 
             *label mylabel
             more blah blah
      #D
              blah de blah

```

If you want to reuse that “more blah blah” text, do this instead:

```

*choice
      #A 
             *gosub mysub
      #B
             blah blah

*choice
      #C 
             *gosub mysub
      #D
              blah de blah
*finish

*label mysub
more blah blah
*return

```

Gosub should always be your preferred way of repeating code anyway, since it makes it easier for a reader to see the structure of the code, and this forces you to not be lazy about this.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [October 4, 2017, 9:09am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/4 "2017-10-04T09:09:03Z")

</div>

I just wanted to point out some “limitation” so if you encounter it, you can make a work around for it (or avoid it).

This doesn’t work 👇🏽

```
*temp loop <Insert some number here>

*label up
*choice
   *if loop = <number1>
      #Choice A 
   *if loop = <number2>
      #Choice B
   *if loop = <number3>
      #Choice C
   *else
      #4th option is always different from the others
         *goto somethingentirelyelse
*goto up

```

> **Instead, do it like this to make it work**
>
> ```
> *temp loop <Insert some number here>
> 
> *label up
> *choice
> *if loop = <number1>
> #Choice A 
> *elseif loop = <number2>
> #Choice B
> *elseif loop = <number3>
> #Choice C
> *else
> #4th option is always different from the others
> *goto somethingentirelyelse
> *goto up
> 
> ```
> 
> * * *

However, if you’re not fancy with such complicated choice-tree, I guess you can just ignore what I post. Just a food for thought.

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [December 7, 2017, 9:54pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/5 "2017-12-07T21:54:47Z")

</div>

Hey, I was giving this a try and I got stuck in how to make a variable receive the value that was sent to a \*gosub\_scene with parameteres. Here is the example I was trying, I made a separate file called “dollartopound” to convert a number I sent from pounds to dollars.

```
*label dollar_to_pound_calc
*params
round(param_1 * 1.33)
*return

```

Then when I want to use it, I was trying to set a variable in the scene I’m in to receive it, but it won’t read if the \*gosub\_scene is on the same line. And if I try to edit the dollar\_to\_pound from the \*gosub\_scene it doesn’t recognize the variable.

```
*set dollar_pound 0
*set dollar_pound *gosub_scene dollartopound dollar_to_pound_calc price_gau5

Price: ${dollar_pound}, which amounts to about £${price_gau5}.

```

If I try to call it from the same line as the Price: it won’t work either. I solved this by putting the converter in the same file and using a \*gosub instead.

```
*label dollar_to_pound_calc
*params
*set dollar_pound 0
*set dollar_pound round(param_1 * 1.33)
*return

```

On this way it worked, which is fine, I have no problem it being in the same file, however how do I make a variable receive a value that is returning from the \*gosub\_scene? I managed to make it display just fine, I just can’t set it.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [December 8, 2017, 1:28am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/6 "2017-12-08T01:28:18Z")

</div>

> [@GoldenSilver](#):
>
> ```choicescript
> *set dollar_pound 0
> *set dollar_pound *gosub_scene dollartopound dollar_to_pound_calc price_gau5
> 
> ```

I assume these codes belong to the “parent” scene, am I right?

You just set it up wrong. That’s why you get the unrecognizable var error.

> **The wrong**
>
> 1. IIRC, any `*command` should be on their own line.
> 2. I don’t recall \*gosub works even thought it’s placed on a same line with any code.
> 3. I see that in your subroutine, you’re lacking `*set <<var>> round...` command on the rounding operator.

The rule is basically this 👇🏽

1. In your “parent” scene

```choicescript
*set food 0 <--- (this is a global variable)
*gosub_scene <<the subroutine.txt>> <<the label>> 1

The food is @{(food+1) nothing|cookies}.

```

1. Now, in the subroutine scene “the subroutine.txt”

```choicescript
*label <<the label>>
*params type
*set food type
*return

```

* * *

If you want this converter subroutine available to not just a variable (which in my example is `food`), you can use “variable referring” with the `{referred var}` tag.

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [December 8, 2017, 1:41am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/7 "2017-12-08T01:41:06Z")

</div>

Ah, I did not thought of setting dollar\_pound this as a global variable (it was temp), this should work.

> [@Szaal](#):
>
> I see that in your subroutine, you’re lacking \*set \<\<var\>\> round… command on the rounding operator.

The variable was dollar\_pound actually. But now that it is global it should work. I was trying to set the temp variable as receiving the value that was calculated by the gosub\_scene, as it is possible to do so in Java, did not know it was more restricted in choicescript.

In Java whatever method you call that has a return will be the return value when you called it, like replacing that big string of the gosub\_scene there with just a number, but here it is different.

---

<div class="post-metadata">

**Author:** ![Alexandra](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alexandra/32/59402_2.png) [@Alexandra](https://forum.choiceofgames.com/u/Alexandra)\
**Post date:** [December 11, 2017, 12:06am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/8 "2017-12-11T00:06:37Z")

</div>

I’m finally getting around to trying params, and quickest isn’t happy with it unless I define param\_1, param\_2, etc. in startup. Is that normal? Just surprised me and took a minute to figure out why I was getting an error…

EDIT: more unexpected errors…

If I try to rename parameters (i.e. `*params messagenumber`), Quicktest fails with the following error:  
TypeError: Cannot read property ‘length’ of undefined

`*if (param_1 = 1)` is read as true even when I’ve defined it as 2

SECOND EDIT:  
I was forgetting I needed the `*params` command even if I didn’t want to rename the variables, it is _running_ properly now. However, quicktest still calls up an error whenever the command `*params` is included in the project. Is this just something else we need to remember to use `*if choice_quicktest` to work around?

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [December 12, 2017, 6:43pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/9 "2017-12-12T18:43:28Z")

</div>

> \*gosub visit “Dracula” “garlic”
> 
> \*label visit  
> \*params  
> You go to visit ${param\_1} and you bring ${param\_2} with you.  
> \*return

Quicktest passes on this for me on a local copy of CSIDE, I’m not sure if this is the very latest version of CS though.

---

<div class="post-metadata">

**Author:** ![Alexandra](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alexandra/32/59402_2.png) [@Alexandra](https://forum.choiceofgames.com/u/Alexandra)\
**Post date:** [December 12, 2017, 7:02pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/10 "2017-12-12T19:02:29Z")

</div>

I’m working with a `*gosub_scene`; maybe the problem’s there?

> **Here's what I've got**
>
> A very abridged version of what I’d actually like to do, trying to find the source of the problem…  
> Startup:
> 
> ```
> *create contacted 0
> *label top
> Params do not seem to be working...
> *choice 
> #Check for a new message
> *gosub ghostmakescontact
> *goto top
> 
> *label ghostmakescontact
> *if (contacted > 0)
> *goto areyoulookingforsomething
> 
> *comment prints the first message
> *gosub_scene ghost printamessage 1
> *set contacted + 1
> *return
> 
> *comment prints a second message
> *label areyoulookingforsomething
> *gosub_scene ghost printamessage 2
> *return
> 
> ```
> 
> subroutine file
> 
> ```
> *label printamessage
> *params 
> *temp thingtodisplay "default message should never be seen"
> *if (param_1 = 1)
> *set thingtodisplay "This message displays the first time."
> *if (param_1 = 2)
> *set thingtodisplay "This message displays the second time"
> ${thingtodisplay}
> *return
> 
> ```

---

<div class="post-metadata">

**Author:** ![CJW](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/cjw/32/111787_2.png) [@CJW](https://forum.choiceofgames.com/u/CJW)\
**Post date:** [December 13, 2017, 12:31am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/11 "2017-12-13T00:31:51Z")

</div>

I was talking crap, sorry. I actually get a ‘couldn’t find scene ghost.txt’ error with your example, if I use \*gosub\_scene (\*goto\_scene works fine). And then a “TypeError: Cannot read property ‘length’ of undefined”, regardless of if \*params is left empty or not. This is only in QuickTest, the game itself runs fine.

Are you on a fresh copy of CS?

---

<div class="post-metadata">

**Author:** ![Alexandra](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alexandra/32/59402_2.png) [@Alexandra](https://forum.choiceofgames.com/u/Alexandra)\
**Post date:** [December 13, 2017, 1:29am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/12 "2017-12-13T01:29:28Z")

</div>

Oh yeah, I had the ‘couldn’t find scene’ error, too, but listing ghost in startup fixed it. I’m using CSIDE 1.1.2 (development version, I believe – I’m on a mac and had the deletion bug)

---

<div class="post-metadata">

**Author:** ![Fiogan](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/fiogan/32/215832_2.png) [@Fiogan](https://forum.choiceofgames.com/u/Fiogan)\
**Post date:** [December 13, 2017, 2:16am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/13 "2017-12-13T02:16:28Z")

</div>

All scenes have to be listed in startup.txt for compiling to work properly anyway, right? I seem to remember it being required when the game goes to CoG/HG…

---

<div class="post-metadata">

**Author:** ![Alexandra](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/alexandra/32/59402_2.png) [@Alexandra](https://forum.choiceofgames.com/u/Alexandra)\
**Post date:** [December 22, 2017, 12:10am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/14 "2017-12-22T00:10:51Z")

</div>

Update on the quicktest problem:  
It turns out, apparently, that telling quicktest to navigate around the \*params command still results in an error:

```
*if not (choice_quicktest)
    *params

```

is not valid.  
However, it seems the problem is only with params used with \*gosub\_scene, as @CJW’s example above within a scene worked fine. So, I tried putting a completely useless subroutine in the malfunctioning scene around the code including the \*params command, and now it works… 🤨

```
*label printamessage
*if (choice_quicktest)
	*gosub sillyquicktest 1
*label sillyquicktest
*params 
*temp thingtodisplay "default message should never be seen"
*if (param_1 = 1)
	*set thingtodisplay "This message displays the first time."
*if (param_1 = 2)
	*set thingtodisplay "This message displays the second time"
${thingtodisplay}
*return
*return

```

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [December 22, 2017, 3:01pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/15 "2017-12-22T15:01:15Z")

</div>

I recommend you always add \*params after the label, so that they are loaded already, even if you do not use them (this won’t result in an error, the params will just be loaded but not used)

I was having problems with CSIDE trying to use \*params, but it was because I was using an old version. After updating to latest or dev version it worked fine in quicktest.

My other \*params attempts worked succesfully, either with \*gosub or \*gosub\_scene.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [December 22, 2017, 4:23pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/16 "2017-12-22T16:23:36Z")

</div>

Ow?  
I got an error when you add \*params on a \*label if you don’t give any value for those parameters.

Here’s my sample, on my startup.txt

```
*label skrinrid
*params as df gh
@{repeat So, d|D}o you wish to activate screenreader mode?
@{repeat [n/][[i]Cannot be changed until game over or restart[/i]]|}
*choice
	#Option 1
		saef
	#Option 2
		dsfa

```

* * *

But then, why would you put `*params` if you’re not going to use it? `¯\_(ツ)_/¯`

---

<div class="post-metadata">

**Author:** ![GoldenSilver](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/goldensilver/32/110153_2.png) [@GoldenSilver](https://forum.choiceofgames.com/u/GoldenSilver)\
**Post date:** [December 22, 2017, 4:28pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/17 "2017-12-22T16:28:21Z")

</div>

Well I didn’t try renaming the \*params though. In one instance I had 2 calculations in this \*gosub, and one requires 3 params, another requires just 2. I was able to use either just fine, giving the required number of \*params depending on which I wanted to use.

```
*label misc_calcs_index
*params
*gotoref param_1

*label dollar_to_pound_calc
*set dollar_pound 0
*set dollar_pound round(param_2 * 1.33)
*return

*label accCalculate
*set finalAcc round(param_2 + ((2*param_3)/1.5))
*return

```

So I use param\_1 to select what calculation I need. If its the dollar\_pound I just need param\_2, for the other one I need param\_2 and param\_3. So when I use this \*gosub I just need to include either 2 or 3 params when I require it. So far it all worked fine in quicktest.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [December 22, 2017, 4:47pm UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/18 "2017-12-22T16:47:47Z")

</div>

Ooh, I see. You had the value ready to be assigned to those parameters.

I thought what you meant with

> [@GoldenSilver](#):
>
> I recommend you always add \*params after the label, so that they are loaded already,

is to literally add `*params` to every `*label` you can find, which surely tingles my rage nerve :"

---

<div class="post-metadata">

**Author:** ![Franzinyte](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/franzinyte/32/170556_2.png) [@Franzinyte](https://forum.choiceofgames.com/u/Franzinyte)\
**Post date:** [May 7, 2018, 8:32am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/19 "2018-05-07T08:32:44Z")

</div>

I think I found a minor bug with \*params and \*gosub\_scene

This works:

```
*gosub stat- "silly" 2 "${var} blabla" 2

```

But this doesn’t:

```
*gosub_scene code stat- "silly" 2 "${var} blabla" 2

```

The error is: Invalid expression at char 10, expected NUMBER, STRING, VAR or PARENTHETICAL, was: OPERATOR

So obviously that’s from the label name “stat-”. Removing the minus sign from the label makes it work, but apparently including a ${var} or `[b][/b] ` in one of the parameters breaks it, because this works:

```
*gosub_scene code stat- "silly" 2 "blabla" 2

```

I can rename the labels, I just prefer to use + or -.

But since it works with normal \*gosub I don’t see why it can’t work with \*gosub\_scene.

---

<div class="post-metadata">

**Author:** ![RETowers](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/retowers/32/21477_2.png) [@RETowers](https://forum.choiceofgames.com/u/RETowers)\
**Post date:** [May 23, 2018, 12:16am UTC](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042/20 "2018-05-23T00:16:35Z")

</div>

Operators in label names is not supported. The “bug” is that it works with `*gosub` in the first place.

[Next page](https://forum.choiceofgames.com/t/new-choicescript-features-implicit-control-flow-gosub-parameters/30042.md?page=2)
