Programming Examples

Reading the Disk with the CATalog? Query

 

 

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

!

****** DISK CATALOG ******

20

!

using the CATALOG? query

30

!

 

40DIM File$[100]

50DIM Specifier$[2]

60OUTPUT 707;":EOI ON"

70OUTPUT 707;":SYSTEM:HEADER OFF"

80OUTPUT 707;":MMEMORY:MSI INTERNAL0" ! select the hard drive

90

OUTPUT 707;":MMEMORY:CATALOG?"

! send CATALOG? query

100

!

 

 

110

ENTER 707

USING "#,2A";Specifier$

! read in #8

120

ENTER 707

USING "#,8D";Length

! read in block length

130

!

 

 

140! Read and print each file in the directory

150!

160FOR I=1 TO Length STEP 51

170ENTER 707 USING "#,51A";File$

180PRINT File$

190NEXT I

200

ENTER 707 USING "A";Specifier$

! read in final line feed

210

END

 

15–11

Page 245
Image 245
HP Sander 16500C manual Reading the Disk with the CATalog? Query, Truncated at 51 characters