• How to count the number of steps
A command or function command in a program uses 1 step.
A line number (numerical value from 1 through 9999) uses 2 steps.
Example;
1 I N P U T A 6 3 3
5 steps
10 B = SIN A 633
2 V I W
1 0 0 P R I N T • 8 = * '
7 steps
10 steps
Tota l 22 steps
5-2 Program Fundamentals
5-2-1 Constants and Variables
Characters which can be used in BASIC are capital letters (A through Z) and numbers (0
through 9) and certain special characters such as symbols, etc.
• C o n s t a n t s
These are fixed numbers which are used in a program and are used to write numerical
values directly into the program.
Example: S = becomes 8 = ;r * R12
2 is the constant.
• V a r i a b l e s
These are numerical values which are used in a program. They are used during execution
to make inputs from the keyboard or to substitute calculation results which were
initially unknown.
A variable is a single capital letter (A through Z) or a single capital letter with "$"
attached (character variable). They may be freely selected from within this range.
Example: S = becomes S * R12
R is the variable.
Example: Y=2*Xt 2-l-3*X-l-4
I I I ■ 1
Variable Variable Constant Constant
Constant Constant Variable
In other words, algebraic terms are "variables" and cxjnstant numbers are "constants".
Also, in addition to the above, there are character constants and character variables.
A character constant is a character string which is written directly and these are
enclosed in quotation marks such as "ABC" and "END". A character variable is not a
numerical value but a variable which contains a character string. Various character
variables can be made by changing the character string.