Tab( ) Is Versatile - Sharp MZ-80A Owner's Manual

Hide thumbs Also See for MZ-80A:
Table of Contents

Advertisement

41
TAB(
) is Versatile
It is possible
to assign
where
to start
writing the
characters or symbols of a
string
on the CRT
screen.
The
TAB(
)
is used to do
so.
Using
PRINT TAB
(8)
;
"ABC", string
ABC
is dis¬
played at
the number in the
parenthesis counted
from
the left hand
side,
namely, starting at the 9th position.
The numbers to be
assigned
for the parenthesis are
from 0
to 78,
and variables may be used if defined as
numerals.
Let's
operate
an example of a simple program combined with
the
FOR
..
.
NEXT statements.
10 FOR
X
=
1 TO 20
10 FORY=lTO20
20 PRINT
TAB (X)
; "
*
"
20 PRINT
TÿB
(20
-
Y) ;
"
*
"
30 NEXT X
30 NEXTY
Now,
let's
try
a little more complex program.
10 PRINT
"
S
'' :
PRINT SPACES (8)
,
20 FOR
X
=
1 TO 22 : PRINT
"
*
"
; : NEXT
X : PRINT
30
FOR Y
=
1 TO 20
40 PRINT TAB (8)
; "
*
" ;
TAB
(29
-
Y) ;
"
"
;
TAB
(29)
;
"
*
" : NEXT Y
:
PRINT SPACES
(8) ;
50 FOR Z
=
1 TO
22 : PRINT "
*
"
; :
NEXT Z
A
new
statement
is
there
at
line numbers
10
and 40. When this
SPACES (
) is substituted for TAB,
exactly
same
result is obtained.
However, there is
the
difference
shown below
between the
SPACES
and TAB.
TAB
(8)
shifts the cursor
by
8 character
space
from the left hand on CRT screen.

Advertisement

Table of Contents
loading

Table of Contents