AT&T 6300 Manual


Written by
Agora Resource, Inc.
Lexington,
MA
©1984, 1985
AT&T
©1983, 1984
By
Microsoft®
All
Rights Reserved
Printed
in
USA
NOTICE
The information
in
this document is subject to change without
notice.
AT&T
assumes no responsibility for any errors that may
appear in this document.

BASIC
Programmers
Guide
Contents
1Introduction
Introduction
1-2
Major Features
1-3
Syntax Conventions
1-4
Line Format
1-7
Character Set
1-9
Reserved Words
1-10
2Getting Started
Initialization Procedure
2-2
Modes
of
Operation
2-3
Keyboard
2-4
The GWBASIC Screen Editor
2-12
Using Your System as aCalculator
2-23
Entering aProgram
2-26
Listing aProgram
2-29
Saving aProgram
2-30
Loading aProgram
2-31
Executing aProgram
2-32
Program Interrupts
2-37
3Variable Types
Constants
3-2
Variables 3-7
Expressions
and
Operators
3-14

BASIC
Programmers
Guide
4Disk File Handling
Device
Independent
Input/Output
4-2
How MS-DOS Keeps
Track
of Your Files
4-3
File Specification
4-5
Commands for
Program
Files
4-18
Disk
Data
Files -Sequential
and
Random
Access
4-21
5Graphics
Selecting
the
Screen
Attributes
5-2
Text
Mode
5-4
Graphics Mode
5-7
6Asynchronous
Communications
Opening Communications Files
6-2
Communication I/O
6-3
Communication I/O
Functions
6-4
7Command References
Introduction
7-2
Commands,
Statements,
and
Functions
with
Examples
7-16

BASIC
Programmers
Guide
Appendices
A
B
c
D
Tables
Hexadecimal Conversion Tables
ASCII Codes
Extended Codes
Hexadecimal to Decimal Conversion Tables
Derived Functions
Advanced
Features
Memory
Allocation
Internal
Representation
Calling
Subroutines
Event
Trapping
Conversion
of
Programs
to
GWBASIC
Introduction
String
Dimensioning
MAT
Functions
Multiple
Assignments
Multiple
Statements
PEEKs
and
POKEs
IF
...
THEN
...
[ELSE
...]
File I/O
Graphics
Sounding
the
Bell
Error
Codes
and
Error
Messages
Error
Messages
Error
Codes
Glossary
Index
Supplement:
Display
Enhancement
Board
A-3
A-4
A-8
A-lO
A-12
B-2
B-4
B-6
B-22
C-2
C-3
C-6
C-7
C-8
C-9
C-I0
C-ll
C-12
C-13
D-2
D-4


1Introduction
•
Introduction
•
Major
Features
•
Syntax
Conventions
•
Line
Format
•
Character
Set
•
Reserved
Words
1-1

Introduction
INTRODUCTION
dWBASIC
is
the
most
extensive
implementation of
BASIC
available for
personal computers.
It
meets
the
requirements
of
the
ANSI
standard
for BASIC, and
supports
many
features rarely found in
other
BASICs.
It
provides sophisticated
string
handling,
structured
programming features,
and
improved graphics.
GWBASIC gives you ease of use plus features
that
make your personal computer perform
at
its
best.
UNIX
is a
trademark
of AT&T Bell Laboratories.
Ms™·bOS
is a
trademark
of Microsoft Corporation.
Microsoft® is aregistered
trademark
of Microsoft Corporation.
1-2

Introduction
MAJOR FEATURES
Some of
the
special features of
GWBASIC
are:
•
UNIX™
style
MS™-DOS interface for auser-
friendly
operating
environment
•Re-directable
standard
input
and
output
•Device communication
commands
to
initialize
and
communicate
with
peripheral
devices
•
Tree-structured
disk
directories
•
Improved
Disk
I/O facilities for
large
files
•
Advanced
screen
editing
•
Enhanced
Graphics
commands
•User-defined Keyboard,
Error,
and
Event
Trapping
•Precise
error
reporting
with
ERDEV
and
ERDEV$
•
Optional
double precision
transcendentals
•Precise control of
memory
allocation
•
CALL
statements
with
parameter
passing
•Chaining
with
common variables
to
programs
larger
than
the
available
memory
•
Optional
declaration of variable
names
1-3

Introduction
{ }
[ ]
1-4
SYNTAX CONVENTIONS
•Uppercase
letters
and
words,
and
the
sym-
bols
listed
below, should be
typed
in
the
actual
line
exactly
as shown.
(),;:=!#$-><
In
the
statement:
WRITE #filenum, list-of-expressions
#
and
the
comma
(,)
after
filenum should be
typed
as
shown.
•Lowercase
letters
and
words
represent
variable
information
(or
parameters)
that
the
user
must
provide.
In
the
statement:
KILL filespec
filespec should be replaced
by
aspecific
value-for
example,
"MYFILE".
•
The
symbols
listed
below are
used
to
define
the
syntax
of
aline,
but
should
not
be
typed
in
the
actual
line:
vertical
stroke
indicates
alternatives
braces
indicate
achoice
brackets
indicate
options
ellipsis
indicates
repetition
underscore
joins
parts
of
names
in
amultiple-
word
parameter

Introduction
•Braces
group
related
items
(divided
by
a
vertical stroke),
such
as alternatives.
{AlBiC}
indicates
that
you
must
choose one of
the
items
enclosed within
the
braces.
AorBorC
•
Brackets
also
group
related
items
(divided
by
a
vertical stroke); however,
everything
within
the
brackets
is
optional
and
may
be
omitted.
[AlBiC]
indicates
that
you
may
choose one of
the
items
enclosed
within
the
brackets
or
that
you
may
omit
all of
the
items.
•
An
ellipsis
indicates
that
the
preceding
item
or
group
of
items
may
be
repeated
more
than
once
in
succession.
A
[,B]
...
indicates
that
A
can
be
typed
alone
or
can
be
followed
by
,B
once or more
in
succession.
1-5

Introduction
1-6
Note
is also
permitted
and
has
the
same
meaning
as
A[,B]
...
•
The
underscore
character
(_)
can
be
used
to
join
names
in
amultiple-word
parameter.
For
example:
ENVIRONS
(nth_parm)
•
Characters
which
appear
in a
listing
in bold
face
represent
characters
entered
through
the
keyboard.

Introduction
LINE FORMAT
GWBASIC lines
may
contain amaximum of
255 characters
~nd
have
the
following format:
[nnnnn]
statement
[:statement]...['comment] CR
AGWBASIC
program
line always begins
with aline number (an unsigned integer in
the
range
0
to
65,529), and ends with acarriage
return·
(CR).
A
program
line is
stored
in
memory as soon as you
enter
CR.
AGWBASIC immediate line,
Le.,
aline
that
is
executed
as
soon as you
enter
it, always begins
with a
l~~ter,
as you have
to
omit
the
line
number in
this
case.
More
than
one GWBASIC
statement
may
be
placed on aline,
but
each successive
statement
must
be
separated
froIl}
the
last
by
acolon.
At
the
end
of aGWBASIC line (before
CR)
you
may
e:q.ter
acomment
string
preceded
by
a
single quotation
mark
(').
Acomment
string
preceded either
by
the
keyword
REM
or
by
asingle quotation
mark
may
also be
written
just
after
the
line number.
You
can
extend alogjcalline over more
than
one physical line
by
pressing CTRL-CR or
by
continuing
typing
and
letting
the
logical line
wrap around
to
the
ne~t
physical line.
All GWBASIC lines shown
in
this
manual
end with CR unless specifically
stated
otherwise.
1-7

Introduction
1-8
Examples:
10
FOR
K=1TO
20
is a
GWBASIC
program
line.
100
GOSUB
1000
'branch
to
SUB1
is a
GWBASIC
program
line
with
a
comment
at
the
end.
1000'SUB1
is a
GWBASIC
program
line which
contains
only acomment.
PRINT
AS
is a
GWBASIC
immediate
line.
•
Every
GWBASIC
program
line begins
with
aline
number.
Line
numbers
indicate
the
order
in
which
the
program
lines are
stored
in
memory. Line
numbers
are also
used
as
references in
branching
and
editing.
For
the
EDIT,
LIST,
AUTO,
and
DELETE
commands, aperiod
(.)
may
be
used
to
reference
the
current
line.

Introduction
CHARACTER SET
GWBASIC
recognizes
upper
and
lower case
letters
of
the
alphabet,
the
digits
0
through
9,
and
the
following special
characters:
Blank
Equals
sign
or
assignment
symbol
+
Plus
sign
-Minus
sign
*
Asterisk
or multiplication symbol
Slash
or
division symbol
Up
arrow
or
exponentiation symbol
Left
parenthesis
)
Right
parenthesis
%
Percent
sign
or
integer
type
declaration
character
#
Number
(or pound)
sign
or double
precision
type
declaration
$Dollar sign
or
string
type
declaration
character
Exclamation
point
or single precision
type
declaration
character
Left
bracket
(*)
Right
bracket
(*)
Comma
Period
or
decimal
point
Single
quotation
mark
(apostrophe)
"Double
quotation
mark
(string delimiter)
Semicolon
Colon &
Ampersand
?Question
mark
(PRINT
abbreviation)
<
Less
than
>
Greater
than
\
Backslash
or
integer
division symbol
@
At
sign
_Underscore (*)
IVertical line
or
pipe
{
Left
brace
}
Right
brace
.Grave accent
Tilde
(*) Since
these
symbols
are
not
used
as
operators
in
the
language,
they
may
be
used
to
define
the
syntax
(see
Syntax
Conventions
above).
They
should
be
typed
in
the
actual
line only
if
they
belong
to
a
string
constant.
1·9

Introduction
RESERVED WORDS
LSET
MERGE
MID$
MKDIR
MKD$
MKI$
MKS$
MOD
NAME
NEW
NEXT
NOT
OCT$
OFF
ON
OPEN
OPTION
OR
OUT
PAINT
PEEK
PLAY
PMAP
POINT
POKE
POS
PRESET
PRINT
PRINT#
PSET
PUT
RANDOMIZE
READ
REM
RENUM
RESET
RESTORE
RESUME
RETURN
RIGHT$
ltMDIR
RND
RSET
EQV
ERASE
ERDEV
ERDEV$
ERL
ERR
ERROR
EXP
FIELD
FILES
FN
FIX
FOR
FRE
GET
GOSUB
GOTO
HEX$
IF
IMP
INKEY$
INP
INPUT
INPUT#
INPUT$
INSTR
INT
IOCTL
IOCTL$
KEY
KILL
LEFT$
LEN
LET
LINE
LIST
LLIST
LOAD
LOC
LOCATE
LOF
LOG
LPOS
LPRINT
GWBASIC
comprises a
set
of
statements,
commands, function names,
and
operator
names
which are
treated
as
reserved words,
and
which
cannot
be used
as
variable names.
The
total
list of
GWBASIC
reserved words is
as
follows:
ABS
AND.
ASC
ATN
AUTO
BEEP
BLOAD
BSAVE
CALL
CALLS
CHAIN
CHDIR
CHR$
CINT
CIRCLE
CLEAR
CLOSE
CLS
COLOR
COM
COMMON
CONT
COS
CSNG
CSRLIN
CVD
CVI
CVS
DATA
DATE$
DEF
DEFDBL
DEFINT
DEFSNG
DEFSTR
DELETE
DIM
DRAW
EDIT
ELSE
END
ENVIRON
ENVIRON$
EOF
1-10

RUN
STRING
USR
SAVE
STRING$
VAL
SCREEN
SWAP
VARPTR
SGN
SYSTEM
VARPTR$
SHELL
TAB
VIEW
SIN
TAN
WAIT
SOUND
THEN
WEND
SPACE$
TIMER
WHILE
SPC
TIME$
WIDTH
SQR
TO
WINDOW
STEP
TROFF
WRITE
STICK
STOP
TRON
WRITE#
STR$
USING
XOR
Introduction
1-11

II
I
IIIII
III
I
IIIII
IIIIIIII
IIIIIIIIIII

2
Getting
Started
•
Initialization
Procedure
•
Modes
of
Operation
•
Keyboard
•
The
GWBASIC
Screen
Editor
•
Using
Your
System
as
a
Calculator
•
Entering
a
Program
•
Listing
a
Program
•
Saving
a
Program
•
Loading
a
Program
•
Executing
a
Program
•
Program
Interrupts
2-1

Getting
Started
2-2
INITIALIZATION
PROCEDURE
To
start
GWBASIC,
the
MS-DOS
operating
system
must
first
be
installed.
When
MS-DOS
has
been
installed
and
the
system
prompt:
A>
is
displayed,
enter
the
GWBASIC
command:
GWBASIC
to
load
GWBASIC
from
the
diskette
inserted
in
drive
A
into
memory.
Upon
loading,
GWBASIC
responds
with
a
screen
similar
to
the
one
shown
below.
GWBASIC
2.02
(C)
Copyright
Microsoft
1983, 1984
AT&T
Personal
Computer
Release
1.1
Copyright
(C)
1984, 1985
by
AT&T, all
rights
reserved
XXXXX
Bytes
Free
Ok
•
Insert
a
diskette
containing
your
G
WBASIC
programs
and
execute
a
program,
or
•
enter
G
WBASIC
program
or
immediate
lines.
•
To
exit
from
GWBASIC
and
return
to
MS-
DOS,
enter:
SYSTEM
This
closes all
data
files
before
returning
to
MS-DOS.
Your
GWBASIC
program
is
no
longer
in
memory.
MS-DOS
remains
resident.
Other manuals for 6300
4
Table of contents
Other AT&T Desktop manuals