EasyManua.ls Logo

Radio Shack TRS-80 Model 4 - Page 271

Radio Shack TRS-80 Model 4
418 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...
PRINT
TAB
I PRINT TAB(n)
Statement
I
Moves the cursor to the n position
on
the current line.
TAB may
be
used more than once
in
a print list.
Since numeric expressions may
be
used
t6
specify a TAB position,
TAB can
be
very useful
in
creating tables, graphs of mathematical
functions,
etc.
TAB can't
be
used
to
move the cursor
to
the left.
If
the cursor
is
to
the right of the specified position, the TAB statement
is
simply
ignored.
The first parenthesis must
be
typed immediately after the word TAB.
If
n
is
greater than
80,
BASIC divides n
by
80
and uses the remainder
of the division
as
the tab position. For example,
if
you enter the line:
PRINT
"NAME";
TAB(85);
"AMOUNT"
BASIC converts TAB(84) into TAB(4). Since the cursor
is
already at
column five after printing NAME, BASIC moves the string AMOUNT to
the next line.
If,
instead,
you
had
typed TAB(85), BASIC would print
AMOUNT
on
the same line.
If
the string
you
are printing
is
too long
to
fit
on
the current line,
BASIC moves the string
to
the next line.
Example
PRINT
TAB(5)
"TABBED
5";
TAB(25)
"TABBED
25"
Notice that
no
punctuation
is
needed after the TAB modifiers.
Sample Program
220
CLS
230
PRINT
TAB(2)
"CATALOG
NO.";
TAB(
16)
"DESCRIPTION
OF
ITEM";
240
PRINT
TAB(39)
"QUANTITY";
TAB(51)
"PRICE
PER
ITEM";
245
PRINT
TAB(69)
"TOTAL
PRICE"
2-145

Other manuals for Radio Shack TRS-80 Model 4

Related product manuals