22
4-1
Program Configuration
A BASIC program consists of commands, statements, and functions.
BASIC Language
Command
Function
Arithmetic operation function
Character string function
Special function
Statement
General statement
Device control statement
Basic Statements designate and control the flow of programs and are generally
used in program lines within a program. Statements are usually created as pro-
grams and executed by the RUN command. Statements can be directly input
and executed from the keyboard.
Basic Commands are usually entered from the command line and control oper-
ations external to the program such as printing and listing. Commands must be
directly input and executed from the keyboard. Commands cannot be inserted
into programs and executed by the RUN command. If commands are inserted
into programs and executed, the commands may not work properly.
Examples:
print, list, run
Functions are self-contained programs which accept one or more arguments,
perform predefined calculations, and return a result(s). There are predefined
BASIC functions for arithmetic and string operations as well as user defined
functions.
Examples:
INT(x), LOG(x), SQR(x)
A program written in BASIC is a series of lines, each of which consists of one or
more statements. If several statement are written on the same line, they must be
separated with colons(:). A line can be no longer than 255 characters. Use single
quote marks (’) to separate comments.
Example of four statements on a line:
10 FOR L=1 TO 100: J=L*I: PRINT J: NEXT L
Line Numbers
Every BASIC program line begins with a line number. Line numbers indicate the
order in which the program lines are stored in memory and are also used as ref-
erences for branching and editing. Line numbers must be in the range of 0 to
63999. A period may be used in AUTO, DELETE, EDIT, and LIST commands to
refer to the current line.
Examples:
LIST. EDIT. AUTO DEL 100–
Character Set
The BASIC character set is comprised of alphabetical characters, numeric char-
acters, and special characters.
The alphabetic characters in BASIC are the upper case and lower case letters of
the alphabet. The numeric characters in BASIC are the digits 0 through 9.
The following special characters are recognized by BASIC:
SP (space) ! ” # $ & ’ ( ) * + , – . / : ; < = > ? [ \ } ^ _
Constants
The following can be used as constants:
Lines and Statements
Program Configuration
Section 4-1
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...