Some general information:..... A few things I haven't sorted out yet, such as what is a Global and String. I think I get the difference between an Element and a Variable in a script - Elements need to be enabled and Variables are to be declared as new in a script, but I'll leave that for now.
?
- This is always a WORK In Progress
- Both Global Elements and a BruControl Variables are a type of variable.
- A Variable is like a place holder or container of some snippets of data. In a lot of cases, you use a variable because you are going to use it more than once.
Dictionary:
variable
noun
1: a quantity that may assume any one of a set of values
a symbol representing a variable
2: something that is variable
a factor in a scientific experiment that may be subject to change
In computers, a variable is a place to hold some snippet of data.
From Wikipedia:
What is a Variable?
Variables are used to store information to be referenced and manipulated in a computer program. They also provide a way of labeling data with a descriptive name, so our programs can be understood more clearly by the reader and ourselves. It is helpful to think of variables as containers that hold information. Their sole purpose is to label and store data in memory. This data can then be used throughout your program.
- Both of the terms are generally used in talking about variables in any computer language and they are similar in meaning to most computer languages. Most computer languages have local Variables and Global ones.
- All variables and Global Elements have some common attributes (properties) in BruControl:
- Type (Basically what kind of Data can it have)
- Boolean = True or False
- Value = a number
- String = Text (even if you put numbers here they are still text and not values)
- Time = a time
- DateTime = a Date and Time
- Scope: Where can they be used:
- Variables are script specific in Scope. It can only be used within the SAME Single Script where it was declared (created).
- Global Element is global in Scope. It can be used in any script.
- Type (Basically what kind of Data can it have)
- Persistent: Means how long the variable lasts.
Global Elements are persistent and non volatile. They will be there even if you close BruControl and then reopen it the next day or next month.
Persistent refers to the container and not the data. The data can be changed at any time. If you do not change the data in a Global Element, it will still have that value when you open BruControl again.
4. The biggest differences between a Global Element and Variables are:
a. Scope
b. Persistent
c . Global Elements are used for DATA EXCHANGE (requires Professional License).