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 #337 background imageLoading...
Page #337 background image
Chapter
10
I
BASIC Keywords
VARPTR
Function
VARPTR
(variable)
VARPTR
([#]buffer)
Returns the offset into BASIC’s data segment
of
a variable
or
a
disk buffer.
Variable
is
a
numeric or string variable.
Buffer
is the number assigned
to
the file when you opened it.
The number sign is optional. It is provided
for
compatibility with
other BASICs.
VARPTR can help you locate a value in memory. When used
with
Variable,
it returns the address of the
first
byte
of
data
identified with
variable.
See the section “How Variables
are
Stored” in Chapter
11
for
the format.
If the
variable
you specify has not been assigned
a
value, an “Il-
legal function call” occurs.
When used with sequential access files, VARPTR returns the
starting address
of
the disk buffer. When used with direct access
files, VARPTR returns the address
of
the FIELD buffer.
If you specify
a
buffer
that was not allocated when loading
BASIC, a “Bad file number” error occurs. (See Chapter
2
for
in-
formation on how
to
load BASIC.)
The offset returned is an integer in the range
-32768
to
32767.
It is always an offset into BASIC’s data segment, regardless
of
whether you have executed
a
DEF SEG to change the segment.
VARPTR is used primarily to pass
a
value to an assembly
language subroutine via USR. Since VARPTR returns an offset
that indicates where the value
of
a variable is stored,
you
can
pass this address
to
an assembly-language subroutine as the ar-
gument
of
USR. The subroutine can then extract the contents
of
the variable with the help
of
the address that you have supplied
to it.
If VARPTR returns a negative address, add it
to
65536
to obtain
the actual address.
335

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