Documentation Center

Definitions

Variables are an essential to any programming language. A variable is an identifier (a name) for a storage location (part of the computers memory) which holds a value of some sort. This just means that you can use the name of the variable to reference a value in the computers memory, and you can use the same name to change the value of the variable. Constants are just variables that cannot be changed.

You may choose almost any name for your variables. The rules may differ a little from programming language to programming language, in Sax Basic you must follow these rules:

  • The name can consist of letters and numbers, but it must start with a letter.
  • You cannot use spaces or periods in the name.
  • Variable names are not case sensitive ("MyVar" is the same as "myvar").
  • In general do not include any non-letter or non-number characters.
  • The name cannot be longer than 256 characters.
  • You cannot use words already taken up by Basic language. For instance Application.

The following shows very basic use of variables:

MyVar1 = 10
MyVar5 = 20
Result = MyVar1 + MyVar5
TextVar = "Variables can contain text"

The variable Result ends with the value 30 and TextVar contains the text within the quotation marks. The variables are really not very useful here but they will be.