# Issue setting text variable to a number and concatenation

**URL:** <https://forum.choiceofgames.com/t/issue-setting-text-variable-to-a-number-and-concatenation/5825>\
**Category:** ChoiceScript Help\
**Created:** [November 8, 2014, 8:44pm UTC](https://forum.choiceofgames.com/t/issue-setting-text-variable-to-a-number-and-concatenation/5825 "2014-11-08T20:44:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crotale](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@Crotale](https://forum.choiceofgames.com/u/Crotale)\
**Post date:** [November 8, 2014, 8:44pm UTC](https://forum.choiceofgames.com/t/issue-setting-text-variable-to-a-number-and-concatenation/5825/1 "2014-11-08T20:44:42Z")

</div>

I’m trying to set a text temp variable for the stats screen but having issues. Pretty sure I am making some basic mistake, but I can’t figure it out. Help would be appreciated.

\*temp moneytext ${money}&" Rald"

\*stat\_chart  
text firstname First Name  
text lastname Last Name  
text moneytext Money

Error message: choicescript\_stats line 5: Invalid expression, couldn’t extract another token: ${money}&" Rald"

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Pyromanci](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/pyromanci/32/2340_2.png) [@Pyromanci](https://forum.choiceofgames.com/u/Pyromanci)\
**Post date:** [November 8, 2014, 9:48pm UTC](https://forum.choiceofgames.com/t/issue-setting-text-variable-to-a-number-and-concatenation/5825/2 "2014-11-08T21:48:59Z")

</div>

Ok I am a little new to choicescript myself, but it looks like you are trying to set a double variable. ${moneytext} would bring up the word money originally from your stat chart. You have confused it by saying moneytext should be both money and rald. Also if you just want to change it for a single chapter it would be easier to just add \*set moneytext “Rald” at the beginning of the chapter. I haven’t tried, but I would assume creating a temp stat that is identical to an already existing permanent stat would produce errors.

---

<div class="post-metadata">

**Author:** ![MutonElite](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@MutonElite](https://forum.choiceofgames.com/u/MutonElite)\
**Post date:** [November 8, 2014, 9:52pm UTC](https://forum.choiceofgames.com/t/issue-setting-text-variable-to-a-number-and-concatenation/5825/3 "2014-11-08T21:52:02Z")

</div>

Just add quotes around ${money}, you’re trying to create a temp variable with text _and_ numbers, need to convert the numbers into text for it to work.

\*temp moneytext “${money}”&" Rald".

---

<div class="post-metadata">

**Author:** ![Crotale](https://avatars.discourse-cdn.com/v4/letter/c/cdc98d/32.png) [@Crotale](https://forum.choiceofgames.com/u/Crotale)\
**Post date:** [November 8, 2014, 10:16pm UTC](https://forum.choiceofgames.com/t/issue-setting-text-variable-to-a-number-and-concatenation/5825/4 "2014-11-08T22:16:44Z")

</div>

That worked, thanks.
