News:

Welcome to our NEW forum! We invite you to sign up today
so it can grow to be a valuable resource to all Toolbox users!

Main Menu

Variables

Started by oblivion, October 13, 2026, 06:53:50 AM

Previous topic - Next topic

oblivion

Is there anything intrinsically different about the data$ variable from -- say -- string$ or a user-created variable?

Let's say I wanted to use the Data: Add function to move stuff into data$ but I wanted to use Data: Add to modify different variables, if I used string$ or mydata$ to hold a copy of a data$ variable I'd previously created while I messed with another version of data$, would anything break?

Paul (Lead Developer)

The data$ variable is just a holder for any text (like string$). You can use either, but only string$ can be modified with the String steps. Don't use a variable name with "data$" in it (like "mydata$"), because Toolbox will match the "data$" value first when running a step, like so:

(Start)
HOW TO USE: Copy from Start to End, and then paste into an action.
REFERENCE : See an example of pasting at alomware.com/paste.png
0001 Data: Assign "test"
0002 Alert: Show a message "mydata$"
(End)

Which results in a message like this:


oblivion

That's helpful, thanks.

However... trying to write code that will effectively maintain two different copies of data$, each held in variables I've created, where a decision about which variable to move into data$, modify and then move back to the variable is just failing miserably. Looking at debug output, I seem to be making multiple identically-named variables rather than just one with variable content. Are variables local to blocks and, if so, is it possible to make them local to the entire action so they can be shared between decision blocks?


Paul (Lead Developer)

Hi Oblivion. I replied to your email. For others reading this topic, it was a bug introduced with v6.0.0.0 for the "String: Assign to variable" step, which has now been fixed for the next release. Thanks for drawing my attention to it! :)

oblivion

I can confirm that variables now work as I expected them to :)

Again for onlookers, I tripped over the problem while trying to develop a version of my Action list script that separated out hotstrings from text expansions; as it needs the (new) tooldata$ variable and the bugfix to work, I'll hold off posting it -- but I'll write it up as a tutorial once the updates have made it into the release version of Toolbox.