144
The
VIC
20
User
Guide
5040 terminates the
loop
by setting I to 60,
and
the subroutine ends, passing
back the entered character in C$.
5000
REM
DISPLAY
FLASHINO
CURSOR
AND
GET
CHARACTER
5010
FOR
1-0
TO
60
5020
IF
1
..
0
THEN
PIUNT".
81";
50318
IF
1-30
THEN
PRINT"
II"
i
5040
OET
C$:
IF
C$<>""
THEN
1-60
5050
NEXT
I
50S0
IF
C$-""
THEN
5000
5070
RETURN
The subroutine starting
at
line 8000
and
ending
at
line 8210 is designed
to
position the
cursor
and
accept a string
entry
of
a specified length. This
subroutine therefore needs to know the screen coordinates (row
and
column)
of
the entry
and
the length
of
the entry before it
can
begin.
LN% contains the length
of
the entry in characters. R %
and
C% contain
the row
and
column
of
the entry. A variable
SP$
is
assigned 22 spaces
and
is
used
at
two points in the subroutine.
Next the cursor-positioning subroutine
is
called
by
the
GOSUB
state-
ment
on
line 8040. Line 8060 prints the
RVS
ON
character, followed by a
block
of
inverse-video spaces
that
show the length
of
the entry to the opera-
tor,
and
then the
RVS
OFF
character.
8000
REM
INPUT
SUBROUTINE
8020
SP$-"
":REI'1
22
SPACES
8040
GOSUI
'000
8060
PRINT"."
iU£FT$(SP'JLN:Y.)i
"I";
8010
GOSUI
'000:REM
POSITION
THE
CURSOR
8100
CC.",,,,,
8110
ClET
C.:
IF
C.-""
THEN
8110
8120
IF
C''''CHR'(13)
THEN
8200
8139
IF
C$-CHR$(20)
THEN
8169
8140
IF
LEN(CC$)(LN:Y.
THEN
cc
...
ec'+C.:PRINT
Cli
81:50
OOTO
8110
8160
IF
ee'a""
THEN
8110
8170
PRINT"111Il
BI" i
8175
REM
DELETE
CHARACTER
FROM
STRINO
ce.
8180
ee''''LEFT'(CC'JLEN(CC')-l)
81'0
OO.TO
8110
8200
IF
LN:Y.)LEN(CC$)
THEN
PRINT
LEFT'(SP'JLNY.-L!N(CC$)
8210
RETURN
Statements
on
lines 8100
through
8150 accept a character from the
keyboard.
If
the character entered
is
RETURN-that
is,
equal to CHR$(
l3)-the
entry is complete. A
branch
to
line 8200 occurs. Any
part
of
the black
bar
on