Specifications

182 Chapter 8
Save and Recall Files
Example Programs for Saving/Recalling a File
550 IF UPC$(Inp_chr$)="Y" THEN
560 INPUT "Input new current folder name you wish",Holder$
570 Holder$=""""&Holder$&""""
580 OUTPUT @Agte4991a;"MMEM:CDIR "&Holder$
590 OUTPUT @Agte4991a;"SYST:ERR?"
600 ENTER @Agte4991a;Err_no,Err_mes$
610 IF Err_no<>0 THEN
620 BEEP
630 PRINT Err_mes$&" occured"
640 PRINT
650 GOTO Input_name
660 ELSE
670 PRINT "new current holder name: "&Holder$
680 PRINT
690 END IF
700 END IF
710 SUBEND
720 !
730 SUB Save_state(@Agte4991a)
740 DIM File$[256],Inp_chr$[30],Err_mes$[50]
750 INTEGER Err_no
760 !
770 Input_name:!
780 INPUT "Input state file name without extension you wish to
save.",File$
790 File$=""""&File$&""""
800 PRINT "file name : "&File$
810 PRINT
820 INPUT "Do you want to change file name again?
[Y/N]",Inp_chr$
830 IF UPC$(Inp_chr$)="N" THEN
840 OUTPUT @Agte4991a;"MMEM:STOR "&File$
850 OUTPUT @Agte4991a;"SYST:ERR?"
860 ENTER @Agte4991a;Err_no,Err_mes$
870 IF Err_no<>0 THEN
880 BEEP
890 PRINT Err_mes$&" occured"
900 PRINT
910 GOTO Input_name
920 ELSE
930 PRINT "save done"
940 PRINT
950 END IF
960 ELSE
970 GOTO Input_name
980 END IF
990 SUBEND
1000 !
1010 SUB Recall_state(@Agte4991a)
1020 DIM File$[256],Inp_chr$[30],Err_mes$[50]
1030 INTEGER Err_no
1040 !
1050 Input_name:!
1060 INPUT "Input state file name without extension you wish to
recall.",File$
1070 File$=""""&File$&""""
1080 PRINT "file name : "&File$
1090 PRINT