Variables
(I'll note at the fore that spacing in equations is generally optional. It's often considered "proper" programming style to include spaces before and after every symbol, so that it's easier for others to read. This is a stylistic thing, and as such is up to the individual to decide what works best. Thus, 2+3=5 is the same as 2 + 3 = 5.)
You probably remember from high school algebra that there are constants (that is, numbers: 4 is 4, has always been 4 and will always be 4), and variables (that is, the ever-present x and y, that end up being whatever they end up being and can change from problem to problem).
Variables work much like you remember from mathematics classes; they take the place of an unknown number (or in this case, a number subject to change)
x = 1 y = x + 3 z = x + y
The preceding cases take the form of definitions. I could tell you that "frabjous" means "excellent", and you would probably believe it until you were later told that "frabjous" means "joyful". The definition changed. This is the same as telling the computer that x = 1 and then later saying that x = 2. The definition of x can vary. Thus, "variable".
Since we're dealing with definitions, there needs to be a single term on the left-hand side of the equals sign. Otherwise, the computer can get confused (and so can the programmer).
As the above example shows, it's also possible to use variables to change the meaning of a variable. In this case, x = 1, y = 4 and z = 5. It's also possible to change the meaning of a variable using itself.
x = 1 x = x + 1
In the first line, you tell the computer what x starts at--in this case, 1. In the second line, you tell it to take the old value of x, add 1, and make that the new value of x. Thus, when those two lines are done executing, x equals 2. If you hadn't already defined x, then x = x + 1 is still valid; x starts out as "nothing," so x + 1 is 1.
OML doesn't care much what you use for variable names, so you can use almost any combination of letters, numbers, and words or upper or lower case, as long as you don't duplicate a command word--that would confuse the computer. The following lines are all valid statements:
x = 1 pd = 56 newpage = 3 newpage2 = 4 SRT = SRT + 3 SomeLongVariableName = SomeOtherLongVariableName
There are several types of variables (a.k.a. "data types"), and not all of them refer to numbers! Here's a list of the ones you'll probably see the most:
Integer Any whole number between roughly -32,000 and 32,000
Long Any number between roughly -2 billion and 2 billion
Single Single-precision; the first 7 digits in engineering notation
(such as 1.0e+10 is 1.0 x 10^10)
Double Double-precision; the first 16 digits in engineering notation
Currency Money notation; anything between roughly -900 trillion and 900
trillion with up to 4 places to the right of the decimal
String Any words or text, including numbers and symbols; everything is
treated as "words" instead of actual numbers or symbols
Variant Any of the above, chosen at time of first use
Next time, more details on how these act and interact...