<< Click to Display Table of Contents >> Navigation: Advanced Features > Scripting > Variables |
•Use a variable for recurring tasks and assign a value to it.
•Global variables are listed in the project explorer.
•Local variables are only used in a single script.
•Use variables in script commands instead of fixed numbers.
•Go to MAIN MENU -> CREATE -> Variable
•A new section is created in the project explorer called Variables.
•This is where the newly created variable is listed.
The current value of a variable can be assigned in the inspector:
Of course, you can assign values to a variable via script commands in any scripting field or in the command section of the status bar:
VariableName.Value = ##
Variable1.Value = 10
Playback2.MixLevel.FadeValue 1, 10
With Variable
Playback2.MixLevel.FadeValue 1, Variable1.Value
You are allowed to rename a variable from default name to let's say FadeInTime.
If renamed, you can use either Variable1.Value or FadeInTime.Value in script commands.
•Local Variables are only valid in a single script.
•You can assign a value to your local variable and use it on different lines in a script.
•All the information about syntax can be found here: Script Command - Local Variables
•Local variables are only valid in their particular script. Unlike global variables, it is impossible to use them in other scripts or with other script commands.
•The variable's name is only valid for this particular script.
Script Parameters
•It is possible assign parameters to a script.
•These parameters can be used as local variables in the script.
•Read more about parameters for scripts: Run a Script with Parameters.