Specifications

Chapter 8 183
Save and Recall Files
Example Programs for Saving/Recalling a File
8. Save and Recall Files
1100 INPUT "Do you want to change file name again?
[Y/N]",Inp_chr$
1110 IF UPC$(Inp_chr$)="N" THEN
1120 OUTPUT @Agte4991a;"MMEM:LOAD "&File$
1130 OUTPUT @Agte4991a;"SYST:ERR?"
1140 ENTER @Agte4991a;Err_no,Err_mes$
1150 IF Err_no<>0 THEN
1160 BEEP
1170 PRINT Err_mes$&" occured"
1180 PRINT
1190 GOTO Input_name
1200 ELSE
1210 PRINT "recall done"
1220 PRINT
1230 END IF
1240 ELSE
1250 GOTO Input_name
1260 END IF
1270 SUBEND
1280 !
1290 SUB Save_data(@Agte4991a)
1300 DIM
File$[256],Inp_chr$[30],File_type$[30],Err_mes$[50],Bool$[3]
1310 INTEGER I,Err_no
1320 !
1330 PRINT "Select the Save Data Array"
1340 PRINT
1350 FOR I=1 TO 4
1360 SELECT I
1370 CASE 1
1380 INPUT "Do you want to save data array? [Y/N]",Inp_chr$
1390 CASE 2
1400 INPUT "Do you want to save data trace array?
[Y/N]",Inp_chr$
1410 CASE 3
1420 INPUT "Do you want to save memory array? [Y/N]",Inp_chr$
1430 CASE 4
1440 INPUT "Do you want to save memory trace array?
[Y/N]",Inp_chr$
1450 END SELECT
1460 IF UPC$(Inp_chr$)="Y" THEN
1470 OUTPUT @Agte4991a;"MMEM:STOR:TRAC:SEL"&VAL$(I)&" ON"
1480 ELSE
1490 OUTPUT @Agte4991a;"MMEM:STOR:TRAC:SEL"&VAL$(I)&" OFF"
1500 END IF
1510 NEXT I
1520 !
1530 PRINT "Select the File Type, ASCII or Binary"
1540 PRINT
1550 INPUT "Input the first letter of a word [A/B]",File_type$
1560 !
1570 Input_name:!
1580 INPUT "Input data file name without extension you wish to
save.",File$
1590 File$=""""&File$&""""
1600 PRINT "file name : "&File$
1610 PRINT
1620 INPUT "Do you want to change file name again?