EasyManua.ls Logo

Radio Shack TRS-80 Model III - Input-Output Statements

Radio Shack TRS-80 Model III
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BASIC
How to Construct
an
Expression
Understanding
how
to construct an
expression
will help you put together
powerful statements
-
instead of
using many short
ones
.
In this section we
will
discuss the two kinds of expressions you
may construct:
Simple
Complex
as well as how to construct a
function.
As we have stated before, an
expression is actually data.
This is because once
BASIC
performs
all
the operations, it
returns one data
item. An expression may be
string or numeric. It may be composed of:
Constants
Variables
Operators
Functions
Expressions may be either simple or
complex:
A simple expression
consists
of a
single term: a
constant, variable or function.
If it is
a
numeric term, it may
be preceded by an
optional + or
sign.
For example:
+ A 3.3
-5
SQR(8)
are all
simple
numeric expressions, since they
only consist of one numeric term.
A$ STRINGS
(20,
A$) "WORD" "M"
are all simple
string expressions since
they only consist of
one string term.
Here's how a simple
expression is formed:
r<±h
kEP
-NOT-
p>-
CONSTANT
VARIABLE
FUNCTION
A
complex expression
consists
of
two or more
terms (simple expressions)
combined
by operators. For
example:
A-1
X + 3.2-Y
1=1
AANDB
ABS(B) + LOG(2)
are all
examples of complex
numeric expressions.
(Notice that you can use the
relational
expression
(1
=
1)
and
the logical
expression
(5
AND
3)
as
a
complex
numeric
expression since both actually
return numeric data.)
A$ + B$
"Z" + Z$
STRING$(10,"A")+"M"
are all
examples of
complex string expressions.
123

Other manuals for Radio Shack TRS-80 Model III

Related product manuals