EasyManua.ls Logo

Radio Shack TRS-80 Model III - Page 181

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
This can
be a
handy short-cut in
examining addresses, for example.
Example Program:
940 REM "WHAT SIDE OF STREET?"
950 REM EVEN
=
NORTH. ODD
=
SOUTH
960 INPUT "ADDRESS: NUMBER AND STREET"? AD*
970
C
=
INT(VAL(AD*)/2)
*
2
980 IF C
=
VAL < AD*) THEN PRINT "NORTH SIDE":
GOTO 960
990 PRINT "SOUTH SIDE": GOTO 960
RUN the program,
entering
street
addresses like
"1015
SEVENTH AVE'
'
.
If the string is non-numeric or
null, val returns
a
zero.
Note: val will not always return the
correct value of
negative numbers although it
does
return the correct value of
positive numbers.
171

Other manuals for Radio Shack TRS-80 Model III

Related product manuals