7-8 Programming
Identifiers
Trio Motion Technology
Identifiers
Identifiers are the names which the programmer uses to identify (!) things in
the program. There are essentially two main types of user-defined identifier,
Labels and Variables.
Labels
Labels are used to provide a place-marker in a program. Not only does this
make the code more readable, it also enables us to direct the flow of our
program to a specific place.
In Trio BASIC, labels are defined by placing a name at the start of the line,
followed by a colon (:).
e.g.
start:
enter_password:
error_handler:
Variables
Variables are storage locations for numeric values. they are called variables as
they can be changed at any time. Just like labels, variables can often be given
a user-defined name. Anywhere a number is required a variable can be used.
Example:
batch_size=10
would assign a value of 10 to a variable called “batch_size”. Then anywhere in
the program that needs to know the value stored to make can read this value
by name.