Before you can use a variable, you must first tell SCR the name of the variable and what type of data the variable will contain. The data type of the variable you wish to declare determines which variable” declaration you use. You can find all of these in the Operators pane of the Formula Editor, under the Variable Declarations heading.
I focus on the most common use of a variable—to store a single. Variables can also be used to store multiple values, as in an array or a range. Keep in mind that Range and Array variables use the same basic rules as single value variables.
Components of a Variable
It is best to first declare the scope of the variable you are about to create. The default scope is global if one is not declared. It is good to be in the habit of declaring variable scope, for there* is no reason to store a global variable, in memory if you arc never going to refer to it somewhere else.
After scope, a variable declaration contains two basic components: the variable data type and the variable name. Then, assign an initial ^ value to [he variable in the same statement by adding the assignment operator arid a value.-
• Scope. Declare the variable scope; global, shared, or local.
• Var. declares the type of variable, such as NurnberVar, Strong-arm, DataVar, etc. depending on the data type.
• x. Name of the variable, such as Weekly Total or First 3 Letters.