Well, I'll give a shot at explaining Variables (computer science). But please read this Wikipedia article first. I think it is pretty good.
With the caveat that I've been immersed in the computer world, and using variables, since I was a freshman in college (~ 48 years ago), I'll try to give a layman's definition of "variable".
A variable is simply a storage location where you can store the value of something, and then refer to that location later by the variable name.
For example, if I state:
x = 5
then I have stored the value 5
in the variable x
.
Let's take some real-world analogies:
- Your Physical Post Office Mail box
- In this case the "Mail Box" is the variable
- It can be set by either the postman, or by you:
- The postman can put mail into the Mail Box. Let's say he/she puts one letter from Apple in your mail box.
- So this is like stating:
Mail Box = Letter from Apple
. - so the value of "Mail Box" is "Letter from Apple"
- The "Mail Box" variable will remain the same until someone changes it.
- You could remove the Letter from Apple, and then the value would be empty
- empty can be represented in various ways:
""
-- (two quotes with nothing between them) means an empty string.- null -- some languages set a new variable to null when it has never been assigned a value.
- To set a KM Variable to empty just use a Set Variable to Text Action, and leave the value field empty (blank). Do NOT enter the two quotes.
- You can set (change) the value of "Mail Box" by either:
- Removing the mail (set to empty)
- Replace the mail from the postman with an outgoing letter. This would set "Mail Box" to "Letter to John" (or whatever).
Your "Mail Box" is very much like a KM Variable, in that it persists day-in and day-out until/if you decide to physically remove it. At any point in time, you may get the value of "Mail Box" by going to it and opening it. Getting it does NOT change the value of it. One you set a KM Variable (in either a Macro or in the Variables Preferences pane), it remains with that value, available to all Macros, until you change it in another Macro (or Preferences). To remove a KM Variable, set it to "%Delete%".
In KM, this would be like using Display Text action (KM Wiki) to view the value of a KM Variable.
Well, I hope this helps. Please let me know either way.