Specifications
Chapter 9 131
Saving and Recalling Files
Sample Program
9. Saving and Recalling Files
Example 9-2 shows a sample program that uses the :MMEM:CAT? command to list
information about the files. You can find the source file of this program, named filelist.bas,
on the sample program disk.
Figure 9-1 shows an example of the listing resulting from execution of this program.
Figure 9-1 Example of the listing resulting from execution of this program
Used size: 276.50[MB] ( 289931264[Byte])
Free size: 798.22[MB] ( 836993024[Byte])
File information:
Name Size[Byte]
==================== ==========
"\STATE1.STA" 148616
"\STATE2.STA" 148616
"\SCREEN.BMP" 921654
Program details are listed below:
Line 50 Set the GPIB address.
Lines 70 to 80 Read information about the 4287A built-in storage and assign it to the
Disk_info$ variable.
Lines 100 to 200 From the Disk_info$ character string, fetch the already used capacity,
free capacity, and file information (names and sizes) separated by
commas (,) and then store them in the Disk_data$(*) array.
Lines 240 to 250 Convert into the values in megabytes, the already used capacity and
free capacity values in bytes that were read.
Lines 260 to 390 List the information that was read.