Specifications

180 Chapter 8
Save and Recall Files
Example Programs for Saving/Recalling a File
Example Programs for Saving/Recalling a File
Example programs for saving/recalling a file are shown below. A file is saved/recalled by
choosing the appropriate sub-program from a menu.
Example program using HTBasic
Example 8-1 shows an example program for saving/recalling a file using HTBasic. This
program is saved under the filename save_rec.htb on the sample programs disk. Below is
an explanation of the program’s details.
Line 50 Sets the GPIB address.
Lines 70 - 390 User calls the sub-program from the menu to save/recall the specified
file and changes the current folder for saving/recalling the file.
Lines 450 - 710 Indicates the current folder and makes changes in it in the sub-program
Chn_curr_holder. Asks to input the file name again if the folder name
is inappropriate.
Lines 730 - 990 Saves the state file under any filename in the sub-program Save_state.
Asks to input the file name again if an error occurs while saving the
file.
Lines 1010 - 1270 Recalls any state file in the sub-program Recall_state. Asks to input
the filename again if an error occurs while recalling the file.
Lines 1290 - 1830 Saves the data file under any filename in the sub-program Save_data.
Before saving, selects the kind of internal data array to be saved in the
file and the file type (ASCII or binary). Asks to input the filename
again if an error occurs while saving the file.
Lines 1850 - 2110 Recalls any data file (in binary format) in the sub-program
Recall_data. Asks to input the file name again if an error occurs while
recalling the file.
Lines 2130 - 2470 Saves the CITIfile under any filename in the sub-program Save_citi.
Selects a model type for the CITIfile before saving. Asks to input the
filename again if an error occurs while saving the file.
Lines 2490 - 2830 Saves a graphics file under any filename in the sub-program
Save_graphics. Selects saving the measurement display in either
bitmap format or JPEG format. Asks to input the file name again if an
error occurs while saving the file.