Download Print this page

Radio Shack TRS-80 model III Owner's Manual page 102

Mini-disk operation, trsdos disk operating system, disk basic programming language
Hide thumbs Also See for TRS-80 model III:

Advertisement

DISK BASIC
The
z-80
routine
should load
into
high-RAM and must
not overlay
the
memory
protect area
reserved
when
you
first
entered
basic
(i.e.,
the
MEMORY SIZE?
prompt).
If
you do
not overlay
basic
or
trsdos,
control
will return to
basic
after
the
program
is
loaded.
Example
The command:
CMD"L
,J
"PROG"
will
load
a
program
file
named
prog
into
ram.
CMD"L"
>P$
will
load
a
program which
has
been
specified as
p$.
CMD"0"
Sort
("Order") an Array
'.'
jt
js\tm.'1iiid9er
variable containing the
number
of
Jfeih^to
be;s.ort9d.;
%
arrayfstert) specifies
an
array element.
The
array contains the data
to
be
sorted,
and
start
is
the subscript
of
the
first
element
to
be
sorted.
The
array
must
be one-dimensional,
string type.
The
string
elements
in
array
may
be
of
any
length.
This
command
sorts
(orders) a
one-dimensional
string array,
i.e.,
a
list.
You
may
sort
all
or part
of
the
array,
depending on
the
values
you
give
to
x and
start.
Sample Program
10
CLEAR
10
*
25
+
50
'ROOM FOR
10
WORDS
+
EXTRA
20
DIM A$(9)
'LIST OF TEN (0-9)
30 FOR ND
=
TO
9
40
PRINT "ENTER WORD
#"5 WD+1
50
INPUT A$(WD)
S0
NEXT
WD
70
N*=iB: CMD
,,
0"
t
NX
>
A$(0)
80
PRINT "HERE
IS
THE
SORTED LIST"
90
FOR WD=0
TO
9
101

Advertisement

loading