EasyManuals Logo

Tandy 1000 Basic Reference Manual

Default Icon
411 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
Page #100 background imageLoading...
Page #100 background image
Chapter
10
I
BASIC Keywords
ASC
Function
ASC(strZng)
Returns the ASCII code for the first character of
string.
ASC returns the value as a decimal number. If
string
is null, an
"Illegal function call" error occurs.
Example
PRINT ASC("A"1
prints
65,
the ASCII code
for
A.
Sample Program
You can use ASC
to
be sure
a
program is receiving proper input.
Suppose you want
to
write
a
program that requires the user
to
input hexadecimal digits
(0-9,
A-F). To
be sure that
only
those
characters are input, and all other characters are excluded, you
can insert the following routine.
100 INPUT "ENTER
A
HEXADECIMAL VALUE";N$
110
A
=
ASCCN$)
'get
ASCII
code
120 IF
A>47
AND
A<58
OR
A>64 AND A<71 THEN PRINT
"OK.":
GOTO
100
130
PRINT "VALUE NOT
OK."
:
GOTO 100
98

Table of Contents

Other manuals for Tandy 1000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Tandy 1000 and is the answer not in the manual?

Tandy 1000 Specifications

General IconGeneral
ProcessorIntel 8088
Processor Speed4.77 MHz
RAM128 KB (expandable to 640 KB)
Operating SystemMS-DOS 2.11
ManufacturerTandy Corporation
Release Year1984
StorageSingle or double 5.25" floppy disk drive (360 KB), optional hard drive
SoundTandy 3-voice sound
PortsParallel, Serial
GraphicsCGA (Color Graphics Adapter)
Graphics Modes320x200, 640x200

Related product manuals