Amos Professional Manual  Contents  Index

the Bare Bones


To introduce a name, or split it up, use the "underscore" character instead of spaces, by typing [Shift] and [-] together. For example:

E> _IAM A_LONG_LEGAL_VARIABLE_NAME=1
   Print _IAM A_LONG_LEGAL_VARIABLE_NAME

Types of variables
There are three types of variable that can be used in AMOS Professional programs.

Whole Numbers
The first of these types is where the variable represents a whole number, like 1 or 9999. These variables are perfect for holding the sort of values used in computer games, for example:

E> HI SCORE=1000000
   Print HI SCORE

Whole numbers are called "integers", and integer variables can range from -147,483,648 up to 147,483,648.

Real number variables
Variables can also represent fractional values, such as 1.2 or 99.99 and the results from this sort of variable can be extremely accurate. The accuracy of numbers either side of a decimal point (known as "floating point" numbers) is fully explained in Chapter 5.3.

Real number variables must always have a "hash" symbol added to the end of their names, which is typed by pressing the tit] key. For example:

E> REAL_NUMBER#=3.14
   Print REAL_NUMBER#

String variables
This type of variable holds text characters, and the length of the text can be anything from zero up to 65,500 characters long. String variables are enclosed in quotation marks, and are also distinguished from number variables by a $ character on the end of their names, to tell AMOS Professional that they will contain text rather than numbers. For example:

E> NAME$="Name"
   GUITAR$="Twang"
   Print NAME$,GUITAR$

Storing variables
All variables are stored in an 8k memory area called a "buffer". This area can hold about 2000 numbers or two pages of normal text, and it has been set as small as possible to allow more space for memory banks and screens of graphics. When there is not enough room left to store all of the variables in a program, an error message will appear saying "Out of variable space". The size of the storage space for variables can be increased at any time, and the only limit to the size of arrays and string variables is the amount of memory available in your computer.

Back    Next
05.01.03