A variable is a container in memory that can take a given or computed value. Variables in ZennoPoster can be created, changed name of a variable and deleted, as well as assigned different values. The most convenient way to work with variables is through the " Variables " window.
You should separate C# variables that are strongly typed and project variables that are not strongly typed. However, the values of these two types of variables can always be converted without data loss or distortion.
Variables are the backbone of any programming project.
How to add an action to a project?
Via the context menu Add Action -> Data -> Variables processing
To increase or decrease the value of the counters.
How to work with an action?
You can assign static strings, numbers, values of other variables, values of environment variables, and also combinations of the above data to a variable.
Counter mode is possible for both increasing and decreasing the value. In this case, the counter can be increased or decreased not only by one but by any number specified in the “Value” field. The value of the variable that is selected in the “Variable name” field is increased / decreased.
Added in ZennoPoster 18.104.22.168
Using this action you can clear variable values.
There are three modes:
All except listed
It might be useful when there is a loop in a project and you have to clear variable values before the new iteration. So the values from the previous iteration won’t affect the new one.
Global Variables and Namespace
Ordinary variables are visible only within one project thread (if the project works in multi-threaded mode, then each thread will have its own local, independent variable)
Global variables are available for all projects and their threads in ZennoPoster.
In order to avoid confusion, global variables have an additional property - the Namespace, which must be specified during creation and when accessing.
Examples of using
Let's look at some practical examples of using variables in projects.
If the condition is not true (the counter is less than or equal to 9), then we increase the count by 1 using the “ Variable processing ” cube (the “ Increase counter ” property) and repeat step 2.
If the condition is true (the counter is more than 9), then we end the processing and output the resulting value of the time variable to the log. We can see the result of the project in the " Variables " window.