Ths Chapter provides you with the bare bones that support AMOS Professional programming. These bones are used to build program skeletons, and you need to understand what they do and how they work before adding the life-blood, the muscle-power and the brain-control that endow a program with its own life.
If you are an experienced programmer, you will already be familiar with these bare bones, and you can safely skip through most of this Chapter.
AMOS Professional is designed to provide you with the easiest and most convenient way of controlling all your programming needs, and even though it provides very powerful programming features, difficult concepts and terms are avoided wherever possible. This section begins with one of the simplest concepts in computing, known as "strings".
Strings
A "string" is a number of characters strung together. A set of quotation marks is
placed at either end of the string to hold it together and keep it separate from the rest of the program.
Each string is also identified by its own name, so that it can be called up by that name, and
used elsewhere in the program. The "dollar" character $ is attached to the end of every string
name, to mark the fact that this name refers to a string. On UK Keyboards, quote marks are typed
in by pressing the [Shift] and [2] keys together, and the $ character is typed with [Shift] plus [4].
Characters in a string can be letters, numbers, symbols or spaces. The following example creates a simple string named A$, and it is defined by letting the name of the string equal the characters enclosed in quotes, like this:
E> "AMOS Professional" Print A$
Here is another example, using three different strings:
E> A$="AMOS" B$="" C$="Professional" Print A$+B$+C$
Strings are extremely useful, and they can act on their own or work together, as that last example demonstrated. Try the next example now:
E> A$="AMOS PROFESSIONAL"-"S" Print A$
The whole of Chapter 5.2 is devoted to how AMOS Professional makes use of strings.
Variables
There are certain elements of a computer program that are set aside to store the results
of calculations. The names of these storage locations are known as "variables".