User`s guide

Table Of Contents
Chapter 9 137
Saving and Recalling (File Management)
Saving and Recalling File
9. Saving and Recalling
(File Management)
The Inp_file_name subprogram in lines 480 to 590, which is used to enter a save filename,
is described below.
Line 500 Allows the user to return to the entry start line and re-enter the data if
an error (such as an invalid entry) occurs while entering the target file
name.
Lines 520 to 540 These lines prompt the user to enter the target file name. The program
does not continue till the user actually enters the file name.
Lines 550 to 560 These lines display the entered file name and waits for a confirmation
entry (y/n key).
Line 570 Returns to the entry start line if the key the user pressed in line 560 is
not the y key.
Example 9-1 Saving file (file_sav.htb)
10 DIM File$[300],Inp_char$[30]
20 INTEGER Content
30 CLEAR SCREEN
40 ASSIGN @Agte507x TO 717
50 !
60 ON ERROR GOTO Content_select
70 Content_select: !
80 PRINT "## Save Content Selection ##"
90 PRINT "Select Content"
100 PRINT " 1: State (State only)"
110 PRINT " 2: State (State & Cal)"
120 PRINT " 3: State (State & Trace)"
130 PRINT " 4: State (State & Cal & Trace)"
140 PRINT " 5: Trace Data (CSV)"
150 PRINT " 6: Screen"
160 PRINT ""
170 PRINT "Input 1 to 6"
180 INPUT "Number?",Inp_char$
190 Content=IVAL(Inp_char$,10)
200 IF Content<1 OR Content>6 THEN Content_select
210 OFF ERROR
220 !
230 CALL Inp_file_name(File$)
240 !
250 SELECT Content
260 CASE 1
270 OUTPUT @Agte507x;":MMEM:STOR:STYP STAT"
280 OUTPUT @Agte507x;":MMEM:STOR """&File$&".sta"""
290 CASE 2
300 OUTPUT @Agte507x;":MMEM:STOR:STYP CST"
310 OUTPUT @Agte507x;":MMEM:STOR """&File$&".sta"""
320 CASE 3
330 OUTPUT @Agte507x;":MMEM:STOR:STYP DST"
340 OUTPUT @Agte507x;":MMEM:STOR """&File$&".sta"""
350 CASE 4
360 OUTPUT @Agte507x;":MMEM:STOR:STYP CDST"
370 OUTPUT @Agte507x;":MMEM:STOR """&File$&".sta"""
380 CASE 5
390 OUTPUT @Agte507x;":MMEM:STOR:FDAT """&File$&".csv"""
400 CASE 6