EasyManua.ls Logo

Radio Shack TRS-80 Model 100

Radio Shack TRS-80 Model 100
210 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...
How program
DA
Y works:
10
READ DAY
ASSIGN TO
D$
TODAY IS
END
Figure 5-1. Flowchart of Program DAY
Line
18
A string from line 60 or 70 is read and assigned to the string variable
0$.
The first time line 10 is executed, the string Sunday will be assigned
to
0$,
the
second time line 10 is executed, Monday will
be
assigned to
0$,
etc.
Line
28
The IF / THEN statement compares DAY$ with the first three characters
stored
in
0$.
DAY$ contains the first three characters
of
the current day (SUN,
MON, etc.). LEFT$(D$,3) returns the three leftmost letters
of
the string stored in
0$.
If
a match occurs, the program jumps
to
line
40,
otherwise line 30 is executed next.
Note that the IF statement does not contain the keyword THEN.
The
keyword is
optional
in
an IF statement when it is followed
by
a GOTO statement.
Line
38
The GOTO statement transfers control back to line
10
where the next day will
be
read from the data list.
Line 48 The PRINT statement displays the message
"TODAY
IS"
followed by the
day
of
the week.
58

Other manuals for Radio Shack TRS-80 Model 100

Related product manuals