Gosub *params bug

I couldn’t find a section for ChoiceScript bugs on the forum, so I’m going to post it here (if a mod knows of such a topic/ section please move it there)

Bug description: Declaring a variable with camelCase style in the *params section of a subroutine will result in a “variable not found” error when trying to use it.

For example:

*gosub pickColor 3

*label pickColor
*params colorIndex

*temp copyOfIndex colorIndex
...

The last line will result in a variable not found error. From what I understand, CS automatically converts all variables in lower case and you can use them in w/e format you wish. This does not seem to happen for params though.

Good catch. I’m not sure what the stance is on camelCase, but I seem to recall that it’s not recommended in ChoiceScript. Still, I would definitely say this is a bug. I think that it’s a one line fix: Fix params case sensitivity by CareyJWilliams · Pull Request #144 · dfabulich/choicescript · GitHub.

But @dfabulich is the one you’ll want to make aware.

2 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.

I just fixed this in the latest version of ChoiceScript on Github. (It can take some time before CSIDE and Dashingdon get updated to incorporate the fixes.)

3 Likes