Reading the Disk with the CATalog? Query
This example program uses the CATALOG? query without the ALL option
to read the catalog of the currently selected disk drive. However, if you do
not use the ALL option, the query only returns a 51-character field. Keep in
mind if you use this program with a DOS disk, each filename entry will be
truncated at 51 characters.
10
!
20
!
30
!
40
DIM File$[100]
50
DIM Specifier$[2]
60
OUTPUT 707;":EOI ON"
70
OUTPUT 707;":SYSTEM:HEADER OFF"
80
OUTPUT 707;":MMEMORY:MSI INTERNAL0"
90
OUTPUT 707;":MMEMORY:CATALOG?"
100
!
110
ENTER 707 USING "#,2A";Specifier$
120
ENTER 707 USING "#,8D";Length
130
!
140
! Read and print each file in the directory
150
!
160
FOR I=1 TO Length STEP 51
170
ENTER 707 USING "#,51A";File$
180
PRINT File$
190
NEXT I
200
ENTER 707 USING "A";Specifier$
210
END
****** DISK CATALOG ******
using the CATALOG? query
Programming Examples
Reading the Disk with the CATalog? Query
! select the hard drive
! send CATALOG? query
! read in #8
! read in block length
! read in final line feed
15–11